[Resolved] Category Archive Page Conditional Tag Help for GP Hooks

Home Forums Support [Resolved] Category Archive Page Conditional Tag Help for GP Hooks

Home Forums Support Category Archive Page Conditional Tag Help for GP Hooks

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #634992
    Derek

    Hi,

    I need a conditional tag for another GP Hook that I want on my category archive pages only. I can’t find one on this FAQ:

    https://docs.generatepress.com/article/using-hooks-conditional-tags/

    Thank you!

    #635001
    Leo
    Staff
    Customer Support

    Hi there,

    This should help: https://codex.wordpress.org/Conditional_Tags#A_Category_Page

    That being said, I would highly recommend you to try GP premium 1.7 (currently in release candidate so we believe it’s stable):
    https://docs.generatepress.com/article/beta-testing/

    The new Elements module will replace this php method writing method and make your life a lot easier. Take a look here:
    https://generatepress.com/gp-premium-1-7/

    #635091
    Derek

    Thanks Leo I’ve gone ahead and upgraded and I can see how this will help A LOT moving forward. There is just one problem though…I do not know how to write the php. I was just copying the code from previous hooks. Here is the code format I was going off previously:

    <?php if ( is_single() ) : ?>
        [fl_builder_insert_layout slug="categories"]
    <?php endif; ?>

    How can I change this to not include a condition?

    <?php [fl_builder_insert_layout slug="categories"] <?php ??????? It’s not working so I know I’m way off πŸ˜›

    #635186
    David
    Staff
    Customer Support

    Hi there, if you’re using GP 1.7 Elements then you just need to add the [shortcode] to the hook, check the Execute Shortcodes and then set your display rules. No need for PHP

    #635563
    Derek

    Ooooooh. Hi David. Yeah, I tried that already, because I assumed that was how the new elements worked, but I hadn’t seen the execute shortcodes check box πŸ˜›

    It works great. VERY useful! I can’t wait to start using this more now that I understand how it works πŸ™‚

    #635565
    David
    Staff
    Customer Support

    Yes it has endless possibilities πŸ™‚

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