Filter to Remove Link From Featured Images on Blog Page

No results found. Try again with different words?

Search must be at least 3 characters.

    Filter to Remove Link From Featured Images on Blog Page

    Do you see the default link on the Featured Image of the Posts on Blog Page?

    Why?

    The Featured Images added to each post are set a link to the same post.

    How to clear?

    From the Astra Theme version – 2.2.2 we providing a filter using which the link to the post can be removed.

    Filter: The filter has been added to remove the featured image link on the blog page.

    /**
      * Remove HTML before tag for link.
      * @param string $markup markup of post.
      * @return string
      */
    function astra_remove_link_before( $markup ) {
        $markup = __return_empty_string();
        return $markup;
    }
    
    /**
      * Remove HTML after tag for link.
      * @param string $markup markup of post.
      * @return string
      */
    function astra_remove_link_after( $markup ) {
        $markup = __return_empty_string();
        return $markup;
    }
    
    add_filter( 'astra_blog_post_featured_image_link_before', 'astra_remove_link_before' );
    add_filter( 'astra_blog_post_featured_image_link_after', 'astra_remove_link_after' );

    Note: Add the above filter to your child theme’s functions.php, here’s an article to help you Add Custom code.

    Was this article helpful?
    Did not find a solution? We are here to help you succeed.

    Related Docs

    Scroll to Top

    Download is Just A Click Away!

    Be among the first to try the beta version of Astra’s Header Footer Builder. Filling the form will ensure you’ll be the first to learn about updates and features.

    Download is Just A Click Away!

    Enter your email address and be the first to learn about updates and new features.