• Resolved paumanok

    (@paumanok)


    Hi, I’m trying to pull in a particular event category using WP_Query, but no luck so far:

    <ul>
    		<?php
    		$event->category->name
    		$my_query = new WP_Query( array( 'post_type' => 'event', 'showposts' => 6, 'cat' => 5) );
    		while ($my_query->have_posts()) : $my_query->the_post(); ?>
    		<?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    			echo "
    <li>";
    			the_post_thumbnail();
    			echo "<span><a href='";
    			echo the_permalink();
    			echo "'>";
    			echo the_title();
    			echo "</span>";
    			echo "</li>
    ";
    			}
    			?>
    		<?php endwhile; ?>
    		</ul>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Any help will be appreciated!

    K.

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CAtegory from WP_Query’ is closed to new replies.