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

Sidebar Image

Did not find a solution? We are here to help you succeed.

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?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Download is Just A Click Away!

Membership Retention Checklist Download

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

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

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

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

Download Free Astra Theme - Modal Popup Form