Why doesn’t this page query work?
Hah. I forgot <?php the_content(); ?>
Hah. I forgot <?php the_content(); ?>
Ok, this is your original meta conditions that describe that you want all posts where key with name from $hideFromHome equals (meta_compare is = by default) true (actually 1 since you concatenate boolean value with string). ‘&meta_key=’ . $hideFromHome .’&meta_value=” . true What you got in second snippet defines key name as pr_hidehome, value as … Read more
I tried reverting back to the older version 3.0.x, but the problem remained the same. The answer can be found here: https://stackoverflow.com/questions/5843214/wordpress-loop-problem-multiple-loops-index-php-and-is-paged-causing-duplicate/5853514#5853514
Not possible in WP 3.2.1. See here http://codex.wordpress.org/Function_Reference/get_pages under “Parameters” and “page_name”. I’m working on exactly the same thing, but it seems I’ll need to resort to to a custom query: http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
You said the post type is called ‘tf_event’, but in the ‘post_type’ array it’s ‘tf_events’.
You can use the $post->post_author, so before your loop add $agent=””; then inside the loop add $agent = $post->post_author; and then create a second query after you loop ends: $agent_query = NEW WP_Query(array(‘post_type’ => ‘agent’, ‘author’ => $agent)); while ($agent_query->have_posts()){ $agent_query->the_post(); //do your agent loop here } wp_reset_postdata();
To understand how to do it you first need to know how the url query works or more specifically what query vars you need, so: ‘post_type’ – to filter by post types. ‘area’ – to filter by area taxonomy. ‘university’ – to filter by university taxonomy. so your url would look like: // http://www.domain.com/?post_type=properties&area=area_term&university=university_term Now … Read more
Try rewinding the Loop, via rewind_posts(), between the two loops? <?php if (have_posts()) : while (have_posts()) : the_post(); ?> asd <?php endwhile; endif; ?> <?php rewind_posts(); // REWIND THE LOOP! ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; ?>
If you are retrieving post(s) by ID, then why do you need terms in query? Post IDs are unique. You likely need post type (because it’s not default), but taxonomy terms only add confusion to the mix. Update Noticed after you added second code sample – post__in has two underscores in it, your examples lack … Read more
This worked for me: include (‘wp-blog-header.php’); and before: while (have_posts()) : the_post(); you have to create wp_query, so do this for example: query_posts(‘cat=1’); // or any other query args you wish