Custom Post Types Category Location

I’m reviewing a site that a previous developer had worked on and trying to pick up where they left off.

It seems they had created two post categories called “Upcoming Events” (slug = upcoming-events) and “Previous Events”(slug= previous-events). They also created a custom post type called “Events”. In the custom post-type editor for anything under events “Events”, both the “Upcoming Events” and “Previous Events” categories appear to the right of the editor under Categories. Each event has one of those 2 categories checked off.

So how come I can’t find a complete listing of upcoming events at any of these links:
http://www.emazzanti.net/upcoming-events
http://www.emazzanti.net/events/upcoming-events
http://www.emazzanti.net/events
http://www.emazzanti.net/category/upcoming-events
http://www.emazzanti.net/category/events/upcoming-events

I cant imagine where else I would find the blogroll for this category.

Please advise. Thanks in advance!

Open your functions.php file and try something like this:


add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) { 
 if(is_category() || is_tag()) { 
   $post_type = get_query_var('post_type');    
if($post_type)     
   $post_type = $post_type;    
else     
   $post_type = array('post','custom-post-type-name'); // add the name of your custom post type 
   $query->set('post_type',$post_type);    
return $query; 
   }}

thanks but that did not work. i added this code exactly to the bottom of my functions.php file, in a new line right after the previous function ended with ?>


<?php

add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) { 
 if(is_category() || is_tag()) { 
   $post_type = get_query_var('post_type');    
if($post_type)     
   $post_type = $post_type;    
else     
   $post_type = array('events','upcoming-events'); // add the name of your custom post type 
   $query->set('post_type',$post_type);    
return $query; 
   }}

?>

please advise. thanks in advance.

I have tried it and it works for me, so I’m not sure what else to advise. Sorry. :frowning:

which link? this one? http://www.emazzanti.net/events/

that link just brings up a designed post and that’s it. It’s not even the most recent and its not the only one in the Events category. I’m looking for an archive page of all the events.

please advise.