Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I used the code and instructions here: <a href="http://wp.miragearts.com/allinone-event-calendar-events-blog-home-categories-tags/" rel="nofollow">http://wp.miragearts.com/allinone-event-calendar-events-blog-home-categories-tags/</a></p> <p>I found with this code added to the functions.php, that if I create two categories (one for regular posts and one for the event custom posts) with the exact same name and slug, then it is basically the same as having one category.</p> <p>I think this may be slowing my site down a bit, but it's really too early to tell if it will cause problems.</p> <p>Here's a copy of the code for the functions.php:</p> <pre><code>// Add this to your theme's functions.php function edit_my_query($query) { // Modify category and tag listings to include ai1ec events and all uses of the same term // across event and post taxonomies // ie live-music or arts whether they are event or post categories // also include ai1ec events in blog home and feeds if ( ( is_home() || is_feed() || is_category() || is_tag() ) &amp;&amp; empty( $query-&gt;query_vars['suppress_filters'] ) ) { // The 'suppress_filters' test above keeps your menus from breaking $post_type = get_query_var('post_type'); if($post_type &amp;&amp; $post_type[0] != 'post') { $post_type = $post_type; } else { $post_type = array('post','ai1ec_event'); // add custom post types here } $query-&gt;set('post_type',$post_type); if (is_category() || is_tag()) { // Add custom taxonomies to category and tag pages if (is_category()) { $taxonomy1 = 'category'; $taxonomy2 = 'events_categories'; } if (is_tag()){ $taxonomy1 = 'post_tag'; $taxonomy2 = 'events_tags'; } $queried_object = $query-&gt;get_queried_object(); $slug = $queried_object-&gt;slug; $query-&gt;set('tax_query', array( 'relation' =&gt; 'OR', array( 'taxonomy' =&gt; $taxonomy1, 'field' =&gt; 'slug', 'terms' =&gt; $slug ), array( 'taxonomy' =&gt; $taxonomy2, 'field' =&gt; 'slug', 'terms' =&gt; $slug ) )); } } } add_action('pre_get_posts', 'edit_my_query'); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload