- This topic has 7 replies, 3 voices, and was last updated 3 years, 7 months ago by
Ying.
-
AuthorPosts
-
August 17, 2022 at 6:52 am #2315518
Kip
Hi,
I’m working on a new theme redesign, in part to move off of WP Show Posts and onto Generate Blocks / Query Loop, and I have some ideas on using the Tags Archive and the Tag Description in ways some maybe non standard ways. I found this: https://wordpress.org/support/article/term-description-block/ which could get me a long way toward what I’m trying to do, can I use it with GeneratePress? Asking here first before digging too much into the weeds, thanksAugust 17, 2022 at 7:31 am #2315541David
StaffCustomer SupportHi there,
you can use the Term Description Block, but as that is expected to appear on an Archive page, you would need to use a Block Element to add that block in an archive.
eg. a Page Hero or other Hook:
https://docs.generatepress.com/article/block-element-page-hero/
Whilst you’re in a Block Element though, you will also find the GP Dynamic Content Block. Which can be used to show the psot content. the post excerpt or the Term Description 🙂
August 17, 2022 at 7:55 am #2315713Kip
Thanks I will look into it, much appreciated 🙂
August 17, 2022 at 8:16 am #2315725David
StaffCustomer SupportYou’re welcome
August 18, 2022 at 10:49 am #2316891Kip
Hey thanks, definite progress!
I’m using a child theme of GeneratePress, and have found thanks to you that I can use the Term Description Block in a Sidebar Widget, set to show only on Archive Pages, to show the description, that’s great.
However, GeneratePress shows the term description by default at the top of the archive page, how do I remove the default term description so I can show it instead in the LH widget?
Took a quick look at Archive.php in the parent theme, but not seeing where to control this.
Thanks again,
kipAugust 18, 2022 at 11:53 am #2316939Ying
StaffCustomer SupportHi Kip,
You can find the code here:
https://github.com/tomusborne/generatepress/blob/adfe090929b0515cdf894f4c6b722cfe8c0790dc/inc/structure/archives.php#L94-L117It’s in the
archives.phpfile, you can remove the lines indicated.Or
simply add this PHP snippet to your child theme’s
functions.phpfile:add_action('wp', function() { remove_action( 'generate_after_archive_title', 'generate_do_archive_description'); });August 18, 2022 at 11:54 am #2316942Kip
perfect, thanks!
August 18, 2022 at 4:01 pm #2317038Ying
StaffCustomer SupportYou are welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.