Tagged: Event calendar, header logo
-
AuthorPosts
-
January 6, 2017 at 12:29 pm #730283
Hello,
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.
add_filter(‘avf_logo’,’av_change_logo_url’);
function av_change_logo_url($url)
{
if( is_page(array(‘academy’,’learning-with-us’)))
{
$url = “http://mysite.com/…/…/logo2.jpg”;
}
return $url;
}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).
Here’s an example: http://brightgreenlearning.com/course/practice-facilitation-and-collaboration-approaches-and-methodologies
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?
Thanks,
EoghanJanuary 9, 2017 at 7:07 am #730994Hey thatcommsguy,
Thank you for using Enfold.
Add the is_singular conditional function.
// https://codex.wordpress.org/Function_Reference/is_singular
if( is_page(array('academy','learning-with-us')) || is_singular('tribe_events'))
Best regards,
IsmaelJanuary 10, 2017 at 9:55 am #731477Many 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.
Thanks…
EoghanJanuary 13, 2017 at 1:06 am #732903Hi,
Try adding this code:
is_post_type_archive('tribe_events')
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. :)
Best regards,
NikkoJanuary 13, 2017 at 10:46 am #733057That’s great Nikko. Many thanks!
January 13, 2017 at 11:24 pm #733360Hey!
Glad we could help :)
Cheers!
Nikko -
AuthorPosts
- The topic ‘Alternative header logo also on custom posts?’ is closed to new replies.