change header for taxonomy event pages

WordPress Event Management, Calendars & Registration Forums General Question change header for taxonomy event pages

This topic contains 2 replies, has 2 voices, and was last updated by  Avi Rosenberg 11 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3622

    Hi
    Thanks for a very nice plugin. I have a question. I am trying to change my site header for the taxonomy event pages. Is there a way to do this by identifying those pages inside the header.php file and making my changes there or should I just create a separate header.php file for those pages?
    Thanks,
    Avi Rosenberg

    Avi Rosenberg
    #3623

    Hi Avi,

    Yes in your header you can use is_tax() (see Codex), e.g.

       if( is_tax( 'event-category' ) ){
           //Event category
       }elseif( is_tax( 'event-venue' ) ){
           //Event venue
        }elseif( is_tax( 'event-tag' ) ){
           //Event tag
       }
    
    Stephen Harris
    #3624

    Hi Stephen
    Thanks for your reply.
    I tried that and for some reason it doesn’t return anything (returns “none”).

    if( is_tax( 'event-category' ) ){
    echo "event-category";
    }elseif( is_tax( 'event-venue' ) ){
    echo "event-venue";
    }elseif( is_tax( 'event-tag' ) ){
    echo "event-tag";
    } else {
    echo "none";
    }

    In the end, I used $_SERVER[‘REQUEST_URI’] and extracted “/events/” from the path and used that.
    I have another question about the widget calendar, but I will open another thread.

    Avi Rosenberg
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.