Site logo

Archived topic

Remove Page Title & Feature Image Link

5 replies · Started by Daniel on April 28, 2022

Viewing posts 1–6 of 6

How can I remove Page Tille & Featured image URL homepage and on every archive page?

1. Add this snippet to remove the H2 Title Link:

add_filter( 'generate_get_the_title_parameters', function( $params ) {
    if ( ! is_singular() ) {
        $params = array(
	    'before' => sprintf(
	        '<h2 class="entry-title"%1$s>',
		'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
	    ),
	    'after' => '</h2>',
	);
    }
    return $params;
} );

2. Add the first snippet in that doc to remove the link for the featured image.

https://docs.generatepress.com/article/generate_featured_image_output/#example

And this doc explains how to add PHP: https://docs.generatepress.com/article/adding-php/

Thanks! It worked.

Glad to hear that!

This archived topic is closed to new replies.