featured image unclickable

Home Forums Modern featured image unclickable

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17660

    snowbolzer
    Participant

    featured image unclickable

    Resolved

    Hello,

    how can i manage to make the featured image unclickable in posts.

    regards
    Achim

    #17661

    Oliver Juhas
    Keymaster

    Hi Achim,

    You probably mean the featured image on a single post page, when you click it, it shows the full size image. First, please note that you can use a plugin to display the image in a lightbox zoom if you want, such as WP Featherlight (can be seen in theme demo website).

    If you still want to disable the image link on single post pages, use this code in your child theme‘s functions.php file:

    function child_theme_post_media_image_featured_link( $link ) {
      if ( is_single( get_the_ID() ) ) {
        $link = false;
      }
      return $link;
    }
    add_filter( 'wmhook_modern_post_media_image_featured_link', 'child_theme_post_media_image_featured_link' );

    Best regards,

    Oliver Juhas
    WebMan Design

    #17662

    snowbolzer
    Participant

    thank you for your quick answer. Yes i want to disable the image link on single post pages. As i don‘t use childtheme yet i have to create one or is it possible by custom css.

    #17663

    Oliver Juhas
    Keymaster

    Hi snowbolzer,

    No, you can’t use CSS in this case as it has nothing to do with CSS coding. Please see the “You might be interested…” links in my previous reply for more info on child theme.

    Best regards,

    Oliver Juhas
    WebMan Design

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.