• Resolved seanrowe

    (@seanrowe)


    I’m looking to create essentially two event pages. One page would list all of my events and one would show only a certain type of event (speaking engagements). I currently have domain.com/events/ showing all of my events, but I’m unsure how to build a page the filters out a certain category or event type.

    Can someone point me in the right direction?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @seanrowe,

    Yes, please override template file called content-single-event_listing.php to you theme side by following this doc

    Add following code in your template file where you want to show event type with link

    if ( $event_type = get_event_type( $post ) ) {
    		if (! empty( $event_type ) ) {
    		    $numType = count($event_type);
    		    $i = 0;
    			foreach ( $event_type as $type ) {
    				// The $term is an object, so we don't need to specify the $taxonomy.
    			    $type_link = get_term_link(  $type );
    			    
    			    // If there was an error, continue to the next term.
    			    if ( is_wp_error( $type_link ) ) {
    			        continue;
    			    }
    				echo '<a href="'.$type_link.'"><span class="wpem-event-type-text event-type '. esc_attr( sanitize_title( $type->slug ) ).' ">'. $type->name.'</span></a>';
    				if($numType > ++$i){
    				    echo $after;
    				}
    			}
    		}
    	}

    Do the same for the category just replace get_event_type() with get_event_category( $post).
    I hope this helps.

    Hi @seanrowe,

    We haven’t heard from you in a while. For now, I am making this resolved. If you still have an issue please create a new thread.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page for specific event type?’ is closed to new replies.