[Resolved] Working with Tag Description Block / Site Editor in GeneratePress?

Home Forums Support [Resolved] Working with Tag Description Block / Site Editor in GeneratePress?

Home Forums Support Working with Tag Description Block / Site Editor in GeneratePress?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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, thanks

    #2315541
    David
    Staff
    Customer Support

    Hi 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 πŸ™‚

    #2315713
    Kip

    Thanks I will look into it, much appreciated πŸ™‚

    #2315725
    David
    Staff
    Customer Support

    You’re welcome

    #2316891
    Kip

    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,
    kip

    #2316939
    Ying
    Staff
    Customer Support

    Hi Kip,

    You can find the code here:
    https://github.com/tomusborne/generatepress/blob/adfe090929b0515cdf894f4c6b722cfe8c0790dc/inc/structure/archives.php#L94-L117

    It’s in thearchives.php file, you can remove the lines indicated.

    Or

    simply add this PHP snippet to your child theme’s functions.php file:

    add_action('wp', function() {
    	remove_action( 'generate_after_archive_title', 'generate_do_archive_description');
    });
    #2316942
    Kip

    perfect, thanks!

    #2317038
    Ying
    Staff
    Customer Support

    You are welcome πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.