New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front page post thumbnail link title refactoring #241

Merged
merged 4 commits into from Aug 12, 2016

Conversation

Projects
None yet
2 participants
@vskjefst
Contributor

vskjefst commented Jul 21, 2016

Pulled code that created title-attribute on anchor-element for the post thumbnail on the front page so that it's easier to override in the child theme.

Pulled code that created title-attribute on anchor-element for the po…
…st thumbnail on the front page so that it's easier to override in the child theme.
@raamdev

This comment has been minimized.

Owner

raamdev commented Jul 28, 2016

@vskjefst

This comment has been minimized.

Contributor

vskjefst commented Jul 29, 2016

@raamdev the intention behind the method was to use it for post thumbnail title only. I use a lot of images with Creative Commons licenses, and thus wanted to easily display the license in the title. I can create a separate method for the title attribute for entry titles. Both methods can share the same code, but it will make it easier for child theme users to show different titles on post thumbnails and title headers. What do you think?

@raamdev

This comment has been minimized.

Owner

raamdev commented Jul 29, 2016

the intention behind the method was to use it for post thumbnail title only

Ah, I understand now. Thanks for clarifying that (more like reiterating! I missed it the first time you mentioned it—sorry).

If you could create a separate method for entry titles and refactor those as well, that would be great.

Also, the independent_publisher_post_thumbnail_frontpage_link_title() method name should not include frontpage, as content.php is used in many other, non-front-page scenarios (e.g., archive pages).

vskjefst added some commits Jul 30, 2016

Moved the code that get the value of the title attribute on post titl…
…es to its own function. Also moved shared code to common method. It should be possible for child theme users to override title attribute values as they please now.
@vskjefst

This comment has been minimized.

Contributor

vskjefst commented Jul 30, 2016

I've pulled the remaining title attribute value code from content.php and moved it to functions.php. If there are any other files than content.php that should use this method, please let me know

@raamdev

This comment has been minimized.

Owner

raamdev commented Aug 1, 2016

@vskjefst Thanks! There are just two more in functions.php that could use independent_publisher_post_link_title_common():

https://github.com/raamdev/independent-publisher/blob/1.7/functions.php#L1156

https://github.com/raamdev/independent-publisher/blob/1.7/functions.php#L1171

@vskjefst

This comment has been minimized.

Contributor

vskjefst commented Aug 2, 2016

Done. I change the two lines so that they use independent_publisher_post_link_title(), and not the common method directly. I thought it made more sense, since it's in essence post link titles, and the common method is just there to pull out code that is shared by methods in the parent theme.

@raamdev raamdev merged commit 96b546c into raamdev:master Aug 12, 2016

@raamdev

This comment has been minimized.

Owner

raamdev commented Aug 12, 2016

@vskjefst Thank you! Merged.

Next Release Changelog:

  • Enhancement: Refactored code that outputs the title="" attribute for Post Title and Post Thumbnail links. The functions independent_publisher_post_link_title() and independent_publisher_post_thumbnail_link_title() can now be easily overridden in a Child Theme. Props @vskjefst. See Issue #241.

@vskjefst vskjefst deleted the vskjefst:feature/post-thumbnail-front-page-link-title-function branch Oct 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment