Site logo

Archived topic

How to remove several elements on single post for specific category

5 replies · Started by mkjj on February 14, 2023

Viewing posts 1–6 of 6

I know this sounds absolutely stupid, but this is what my customers wants: I have to remove several elements from single posts of a specific category: title, featured image, date, category link and navigation. I'm not quite sure what would be best practice in this case.

I could use quick and dirty CSS, but I don't like this approach.
I could use a layout element. This works fine for title and featured image, but not for date, category link and navigation (next/previous post).
I could create a custom template. That would do the trick, but I usually avoid modifications of template files. More often than not, GP provides a much better way (a hook, for example).

Any help would be very appreciated. Thank you!

Mike

Hi Ying,
thank you very much. option_generate_blog_settings would effect the archive page, not the single post, right? Sounds very powerful, but will probably not do the trick here.

The block element - post meta template seems a great option. Unfortunately, I usually disable the block editor. I'm not a big fan of that thing. :-)

I think, I will go the CPT route using a customized template.

It's always amazing to see how many features GP provides. But sometimes it needs the good old custom template. :-)

Thanks again,
Mike

Yikes! I should read more carefully. This is awesome! The code snippet gives me all the options that I need. Beautiful! :-)
Thank you very much. You never cease to surprise me!

Mike

Glad to hear that :)

This archived topic is closed to new replies.