Customizing Upcoming Event Headings and category Images

Home Forums Calendar Products Events Calendar PRO Customizing Upcoming Event Headings and category Images

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1138797
    STEVEN CYRKIN
    Participant

    Is there a way for an upcoming event heading to display both the category and subcategory?

    For example, if I use the event category AUCTIONS with the subcategory HOMES, it currently displays the heading “Upcoming Events>Homes” when I’d like it to display “Upcoming Events>Auctions>Homes.”

    I’d also like to be able to have a custom image on category and subcategory pages, so if the auction is for homes, there is an image for the page related to home auctions.

    Thanks

    #1138823
    STEVEN CYRKIN
    Participant

    I could also display “UPCOMING AUCTIONS>HOMES”. I might be even happier with that. Thanks

    #1139308
    Nico
    Member

    Hi there Steven,

    Thanks for reaching out to us! I’ll help you here…

    Just paste this snippet in your theme’s (or child theme’s) functions.php file:


    /*
    * Alters event's category archive title
    */
    function tribe_alter_event_archive_titles ( $title, $depth ) {

    if ( is_tax( Tribe__Events__Main::TAXONOMY ) && $depth ) {

    $cat = get_queried_object();

    if ( $cat->parent > 0 ) {
    $subcat = $cat;
    $cat = get_term( $cat->parent, Tribe__Events__Main::TAXONOMY );
    }

    $title = 'Upcoming ' . $cat->name;

    if ( isset( $subcat ) ) {
    $title .= ' › ' . $subcat->name;
    }

    $title .= '';

    }

    return $title;
    }
    add_filter( 'tribe_get_events_title', 'tribe_alter_event_archive_titles', 11, 2 );

    I’d also like to be able to have a custom image on category and subcategory pages, so if the auction is for homes, there is an image for the page related to home auctions.

    There are a couple of plugins to attach images to taxonomies (like Event Categories): Categories images, Category Featured Images, etc.

    Please give that a try and let me know about it,
    Best,
    Nico

    #1147624
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Customizing Upcoming Event Headings and category Images’ is closed to new replies.