Skip to content

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

@joe9663

Description

@joe9663

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions