Hello,
I am trying to setup conditional rules for the logo based on what the URL of the page contains. My aim is the home page (/) will have the default logo, and all pages under one parent will a different logo, and another parent pages will have another different logo.
So:
/home/ = Default logo in Enfold settings
/parent1/ = Custom Logo 1
/parent1/page1/ = Custom Logo 1
/parent2/ = Custom Logo 2
/parent2/page2/ = Custom Logo 2
and so on…
I’m currently using
add_filter('avf_logo','av_change_logo');
function av_change_logo($logo)
{
if(is_page( array( 13, 17, 20, 23, 26, 28 ) ) )
{
$logo = "URL of Custom Logo 1";
}
f(is_page( array( 14, 15, 21 ) ) )
{
$logo = "URL of Custom Logo 2";
}
return $logo;
}
Is there anyway to make it so that I don’t have to put in a page ID everytime I create a new page under the parent page? Thank you!
Hey koonpete,
You would need to check the parent page of the current page and include this check in your if statements. This post on stackoverflow may help you: https://stackoverflow.com/questions/13916783/check-if-a-page-is-a-parent-or-if-its-a-child-page
Best regards,
Peter