[Support request] Conditional Section Display

Home Forums Support [Support request] Conditional Section Display

Home Forums Support Conditional Section Display

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #339284
    Marcelo

    Hello Tom,
    i have this conditional:

    <?php if (! is_user_logged_in()) { echo '<p class="box-padding-wosection"><a><i class="fa fa-info" aria-hidden="true">TEXT HERE</a></p>'; } ?>

    But i whant to know if can i use a function that canuse for display or hide an selected Section.

    #339562
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    So you’re wanting to hide or show a GP Section (the add-on) based on whether the user is logged in or out?

    #339567
    Marcelo

    Correct Tom!
    And do this maybe in the function.php childtheme.

    #339794
    Tom
    Lead Developer
    Lead Developer

    Looked into this today, currently the only way to do it would be using CSS (which is less than ideal for this kind of case).

    I’ve made a note to try to integrate something into Sections to make it possible in a future version.

    #340284
    Marcelo

    Awesome! Thank you Tom.
    I resolve this momentary doing this in the Hook Addon:

    <?php if (is_shop() || is_product_category() || is_page(2) || is_product()) { echo 'HTML and TEXT'; } ?>

    #340441
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

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