Site logo

Archived topic

Featured images just in search, tag or category

10 replies · Started by agustinh on March 9, 2021

Viewing posts 1–11 of 11

Hello team,

I would like to know how I can show thumbnails only in searches, categories and tags, but not in the blog section.

I would like to show the same, blog with full excerpt and rest with featured image with link to the result.

I don't know if I make myself clear. Please forgive my poor English.

Thank you very much for your help.

Great job. Congratulations.

Hi there,

Can you give this PHP snippet a shot and see if this is what you want?

add_filter( 'option_generate_blog_settings', function( $options ) {
    if ( is_front_page() && is_home()  ) {
        $options['post_image'] = false;
    }

    return $options;
} );

Adding PHP: https://docs.generatepress.com/article/adding-php/

Thank you very much for your help.

The filter partially solves the problem.

Now I show the thumbnail, but also the first part of the post, and I would like to show only an excerpt.

Solved!

It's alive!

What I needed was another condition, that would allow me to leave searches, categories and tags different from how we show the front page.

I solved it with a precondition in your function.

On the other hand...

I have not been able to have the same css styles in the public part of the blog and in the editor.

Is it possible?

Thanks again!

I am referring to the fonts used in the public part as in the internal editor of Wordpress.

Outside I have ("Open sans"), and in the visual editor of the post appears (Georgia, "Times New Roman", "Bitstream Charter", Times, serif).

I would like the css of the visual editor to be the same as we have for the public part.

Thanks!

Hi there,

are you using the Block Editor or the Classic Editor ?

Hi David!

Classic editor :)

Thanks,
Agustin

Hi Tom,

Perfect, it works!

Thanks!

No problem :)

This archived topic is closed to new replies.