- This topic has 5 replies, 2 voices, and was last updated 3 years, 2 months ago by
Ying.
-
AuthorPosts
-
February 14, 2023 at 11:34 am #2533334
mkjj
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
February 14, 2023 at 3:25 pm #2533511Ying
StaffCustomer SupportHi Mike,
You can try this filter:
https://docs.generatepress.com/article/option_generate_blog_settings/Or you can create a
block element - post meta templateto define a specific post meta template for certain category.
https://docs.generatepress.com/article/block-element-post-meta-template/February 14, 2023 at 11:40 pm #2533718mkjj
Hi Ying,
thank you very much.option_generate_blog_settingswould 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 templateseems 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,
MikeFebruary 15, 2023 at 10:11 am #2534486Ying
StaffCustomer Supportyou are welcome 🙂
option_generate_blog_settingsworks for the single post as well, if you scroll down you can see the single options, eg:
https://docs.generatepress.com/article/option_generate_blog_settings/#options-%E2%80%98single_date%E2%80%99February 15, 2023 at 10:22 am #2534495mkjj
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
February 15, 2023 at 11:06 am #2534552Ying
StaffCustomer SupportGlad to hear that 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.