Site logo

Archived topic

Conditional Section Display

5 replies · Started by infocus on June 26, 2017

Viewing posts 1–6 of 6

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.

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?

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

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.

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'; } ?>

Awesome :)

This archived topic is closed to new replies.