Multiple loops on the same page removing post tags

Sorry guys, stupid mistake, I forgot to reset the second loop using wp_reset_query, here is the working code, <?php query_posts(array(‘category_name’ => ‘test’)); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div><?php the_excerpt(); ?></div> <?php endwhile; ?> <?php endif; ?> <?php wp_reset_query(); ?> Thanx anyways though!

Custom loop with conditional statement to separate each terms

Here is how you can group your post listing based on their terms. First you need to add the following code to your functions.php // join the term_taxonomy table so we can get the term id with the post add_filter( ‘posts_join_paged’, ‘wpse39380_posts_join’, 10, 2 ); function wpse39380_posts_join( $join, $query ) { // you need to … Read more

Get titles of all posts with current tags except current post

First things first, you have a syntax error: $page_title = the_title(); The the_title() template tag echoes, rather than returns, the post title. You will want to use get_the_title() instead: $page_title = get_the_title(); Second, you can simplify things considerably, simply by excluding the current post from your secondary query, by passing the post__not_in post parameter to … Read more

wordpress change the loop order by dynamic value

At the moment you publish/update the post with recommended price, it’s better to have another custom meta post to save the real price in it by using add_action() and add_post_meta(), then you can use the query you posted but with $query_args[‘meta_key’] = ‘real_price’; Something like below: function wp_po54785( $post_id ) { $recommended_price = get_post_meta( $post_id, … Read more

Custom search form to display users only

I am not going to write your form for you, but create a form and submit it to a page to do the processing, or use the AJAX API. Then use WP_User_Query to actually search for users. It is a very WP_Query-like class that should let you do everything you want including search for user … Read more

Pulling current post/page data into header.php

Main query is actually processed before template is loaded, so data is available in header (if a little less convenient to use). You don’t actually need loop, get_the_ID() should give you ID for the queried object and most template tags have version that will return you results for that specific ID. Loop would work just … Read more

Sort Posts By Category?

You have the orderby parameter in your query but you are missing the companion order. This gives ascending/descending rule to the sortation. WordPress Codex reference

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)