query_posts() ALWAYS displays something?

query_posts() ALWAYS displays something? No it doesn’t at least not for me, i’ve tried the code you posted inside my child theme and was unable to reproduce the issue described. Firstly, i tried… while ( have_posts() ) : the_post(); ?> <!— DO NOTHING ! –> <?php endwhile ?> ..and got nothing, so i then tested.. … Read more

Order query by meta_value with multiple custom fields

You can use meta_query to get only posts with display_submenuexpositions = true and order them by order_submenuexpositions. $args = array( ‘orderby’ => ‘meta_value’, ‘meta_key’ => ‘order_submenuexpositions’, ‘meta_query’ => array( array( ‘key’ => ‘display_submenuexpositions’, ‘value’ => ‘true’, ‘compare’ => ‘LIKE’ ) ) ); $query_posts( $args );

Exclude newest post from category X but show rest

A while back i posted a simple function that gets latest post in a certain category: function get_lastest_post_of_category($cat){ $args = array( ‘posts_per_page’ => 1, ‘order’=> ‘DESC’, ‘orderby’ => ‘date’, ‘category__in’ => (array)$cat); $post_is = get_posts( $args ); return $post_is[0]->ID; } So once you have that function you can use use WP_Query or query_posts and using … Read more

previewing my posts on static page?

You will need to set a Static Page as your front page, create and assign a PHP Template for that page, and stack multiple Queries in the template to search out your required categories and display them. Here is one, you might have many: // get the last post (any date) from ‘Featured’ category $featured … Read more

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