Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1147042

    Hello. Using the Avia page builder, I have added a color element to my home page. With custom PHP code added to my child theme’s functions.php file, is it possible to ensure this section does not display?

    The motivation for my question is that I want this section to display only if a certain condition is met–a condition I am testing with PHP.

    Thanks.

    #1147413

    Hey FeedXL2019,

    No, the code in the functions.php will not work here, you need to work with the code that renders the Advanced Layout Builder page which is /enfold/template-builder.php.

    Best regards,
    Victoria

    #1147751

    Sorry, but I’m not sure what you’re saying. Maybe I should re-phrase my question. I have a color section element added to my home page. Does the theme provide a PHP function/hook which allows me to hide this section, using PHP code?

    Thanks.

    #1148355

    Hi FeedXL2019,

    Unfortunately there’s no hook for this.
    However, the workaround that I think would work for you is either to modify Color Section element or create a different version of Color Section, you can find in our documentation on how to do it: https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb

    Best regards,
    Nikko

    #1148364

    >> However, the workaround that I think would work for you is either to modify Color Section element or create a different version of Color Section,

    OK. Let’s say I created two different sections: Section A and Section B. How would I then ensure–using just PHP (and no CSS)–that only Section A is displayed between October 22 and October 29, and only Section B is displayed at all other times? I am looking for an automated solution, not a solution in which I have to manually make changes on those dates.

    It looks like that is not easily done–correct?

    #1148743

    Hi FeedXL2019,

    Yes, that’s not easily done and making an automated solution would also make it more complex.
    The workaround I suggested was a possible solution that I could think of since what you’re trying to achieve isn’t an available option.

    Best regards,
    Nikko

    #1148868

    OK got it. The automated portion is a requirement, and the workaround unfortunately doesn’t meet that requirement.

    I have a separate workaround–using PHP and CSS–which should be acceptable. Thanks for your help. We can consider this resolved.

    #1149065

    Hi FeedXL2019,

    Glad that you got a workaround it :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to hide element with PHP?’ is closed to new replies.