-
AuthorPosts
-
October 11, 2019 at 7:25 am #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.
October 12, 2019 at 3:48 pm #1147413Hey 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,
VictoriaOctober 14, 2019 at 8:56 am #1147751Sorry, 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.
October 16, 2019 at 9:44 am #1148355Hi 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-albBest regards,
NikkoOctober 16, 2019 at 10:20 am #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?
October 17, 2019 at 2:26 am #1148743Hi 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,
NikkoOctober 17, 2019 at 10:44 am #1148868OK 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.
October 18, 2019 at 1:45 am #1149065Hi FeedXL2019,
Glad that you got a workaround it :)
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘How to hide element with PHP?’ is closed to new replies.