Skip to content

Front page post thumbnail link title refactoring - #241

Merged
raamdev merged 4 commits into
raamdev:masterfrom
vskjefst:feature/post-thumbnail-front-page-link-title-function
Aug 12, 2016
Merged

raamdev merged 4 commits into
raamdev:masterfrom
vskjefst:feature/post-thumbnail-front-page-link-title-function

Conversation

@vskjefst

Copy link
Copy Markdown
Contributor

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.

…st thumbnail on the front page so that it's easier to override in the child theme.
@raamdev

raamdev commented Jul 28, 2016

Copy link
Copy Markdown
Owner

@vskjefst https://github.com/raamdev/independent-publisher/blob/1.7/content.php#L27 could also be refactored to use the new function.

@vskjefst

Copy link
Copy Markdown
Contributor Author

@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

raamdev commented Jul 29, 2016

Copy link
Copy Markdown
Owner

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 2 commits July 30, 2016 12:48
…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

Copy link
Copy Markdown
Contributor Author

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

raamdev commented Aug 1, 2016

Copy link
Copy Markdown
Owner

@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

vskjefst commented Aug 2, 2016

Copy link
Copy Markdown
Contributor Author

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

raamdev commented Aug 12, 2016 •

Copy link
Copy Markdown
Owner

@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 feature/post-thumbnail-front-page-link-title-function branch October 15, 2016 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants