Skip to content
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

[Feature] Allow Post featured image to link to post single page #399

Closed
joe9663 opened this issue Jun 4, 2021 · 0 comments
Closed

[Feature] Allow Post featured image to link to post single page #399

joe9663 opened this issue Jun 4, 2021 · 0 comments
Labels
Feature Request Feature Request
Milestone

Comments

@joe9663
Copy link

joe9663 commented Jun 4, 2021

Is your feature request related to a problem? Please describe.
Featured images on the blog page do not link to the individual post, currently the just function as images. User wanted to be able to click on the featured image to view a post in addition to clicking the post title.

Describe the solution you'd like
Adding a toggle to control whether or not the featured image links to its associated post.

Describe alternatives you've considered
Used a filter on post_thumbnail_html to add the link for the post.

function link_featured_images( $html, $post_id, $post_image_id ) {
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';
return $html;
}
add_filter( 'post_thumbnail_html', 'link_featured_images', 10, 3 );

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants