Based on other threads here I’ve successfully enabled an alternative header logo on specific pages of my site by adding the code below to the functions.php file of my child theme.
$url = “http://mysite.com/…/…/logo2.jpg”;
I would also like to do this above instances of what I believe are in effect custom posts, namely Events added under the Event Calendar plugin (Modern Tribe).
And I’d also like to show the same alternative logo on the calendar’s homepage: http://brightgreenlearning.com/courses (This is part of the WordPress Loop?)
Is there some code I can add to functions.php that will do the same for the custom posts and loop as my is_page code is doing for pages above?
Thank you for using Enfold.
Add the is_singular conditional function.
if( is_page(array('academy','learning-with-us')) || is_singular('tribe_events'))
Many thanks Ismael. That worked perfectly.
I have one more related question, if you don’t mind: is there an is_ function that I can use to do the same thing on the calendar page from the Event Calendar (https://brightgreenlearning.com/courses or https://brightgreenlearning.com/course)?
It doesn’t work if I simply add them to the is_page array, as I guess they’re not actually pages.
Try adding this code:
It should look like this:
if( is_page(array('academy','learning-with-us')) || is_singular('tribe_events') || is_post_type_archive('tribe_events'))
Let us know if this helps. :)
The topic ‘Alternative header logo also on custom posts?’ is closed to new replies.