Articles of query posts

Display Custom Post Type Fields

I’m making a website and want to display Events. Therefore I made a Custom Post Type called ‘event’. I’m querying events to show them in a page. The Events I made also have some custom fields like : ‘Location’, ‘Day’, ‘Month’, ‘Year’ and a category. This is my code now : <?php $args = array( […]

Query with custom taxonomy not working

I have custom post type ‘mix‘. And custom taxonomy ‘meal‘. And categories in custom taxonomy (one of that is with slug: breakfast) I have problems with making query. My code is : $args = array( ‘post_type’ => ‘mix’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘meal’, ‘field’ => ‘breakfast’ ) ), ‘posts_per_page’ => 50 ); $query […]

Displaying the last post on static homepage

(It might not be the first time this question is asked, but every time I found someone else asking it elsewhere, the post was very old and the method used wasn’t efficient anymore.) ► I’d like to be able to show the last article of a specific category (let’s say the category is “news”) on […]

making random query button using $_GET

Im trying to make my post random when i lick on my button using $_GET but it just keeps refreshing my page instead of refreshing with the random post. <a href=”<?php echo $my_query; ?>?p=random”><img src=”<?php bloginfo(‘template_directory’); ?>/images/shakeup.png” alt=”” /></a> <?php if(isset($_GET[‘p’]) && $_GET[‘p’]==’random’) {?> <?php $my_query = new WP_Query(‘orderby=rand’); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); […]

Is it possible to query_posts using post__in and then Loop through them in the ordered they were queried?

query_posts( array ( ‘post__in’ => array( 5, 76, 21, 56, 3 ) ) ); I’d like to query the Loop using post__in and a set WordPress IDs. I’d then like to run through the Loop in the exact order of the query. Does anyone know if that is possible?

Order posts using a custom array

I have an array of post ids which I’m passing to query_posts using ‘post__in’. My question is how can I use the order from my array rather than ordering by ‘date’ etc?

how can i get posts from custom post type particular taxonomy category

I have registered custom post type Article in my template using register_post_type function. and i also having taxonomy category for this article posts. Here i want to filter the posts under particular category. using query post How can i do this Thanks in advance !

How to insert content from another Custom Post type into Post?

Say I have a custom post type called “Performers”. This gets populated with different bands/performers. These posts have a featured image as well as custom fields (mp3 file, facebook link, myspace link, etc). I have another custom post type called “Events”. When I create a new Event post, I would like the option to have […]

Read More is not working in query posts

I have Query_posts in my page. the posts have tags to separate for read more, But while doing query posts it is pulling all content for <?php the_content(‘read more..’);?>

How to reverse the order of WordPress blog posts?

WP 3.0.2 I’ve tried adding <?php query_posts($query_string . “&order=ASC”) ?> above <?php if(have_posts()) : ?> in the page.php file, with no result