[Plugin: Events Manager] Conflict with WP_Query content
-
I’m using WP_Query to call up a couple “recent Posts in category x” in my sidebar. For the most part, there’s no conflict, except on event-tag and event-category pages.
On tag pages, my custom queried titles and custom meta text shows up fine, but the_content or the_excerpt text is replaced with the content of the tag page, which in my case means a list of upcoming events and times with that tag.
The category pages are similar- my custom query works for titles and meta data (and even the post ID), but the actual text output from the_excerpt is the category description text.
Here’s my sidebar code:
<?php $first_recent_article = new WP_Query(array('category_name' => 'articles', 'posts_per_page' => '1')); while ($first_recent_article->have_posts()) : $first_recent_article->the_post(); $do_not_duplicate = $post->ID; ?> <li> <a href="<?php the_permalink() ?>"><?php the_post_thumbnail('headshot'); ?></a> <div class="entry"> <h4><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h4> <span class="byline"><?php $GuestAuthor = get_field('guest_author_name'); //Coming from Advanced Custom Fields echo $GuestAuthor; ?></span> <?php the_excerpt(); ?> </div> </li> <?php endwhile; ?> <?php wp_reset_postdata(); // reset the query ?>
I can confirm that this behavior does not happen with regular Post tag or category pages. Is there something about how the event-tags and event-categories descriptions are getting called that they’re overriding my queried content?
Thanks for any help you can offer,
Z-247
- The topic ‘[Plugin: Events Manager] Conflict with WP_Query content’ is closed to new replies.