Help in query for list links

Try it like this: $dates = array(); // declare an array to hold dates echo ‘<ul>’; if (have_posts()) : while (have_posts()) : the_post(); $thisday = get_the_time(‘m/d/Y’); // this post’s date if (!in_array($thisday,$dates)) { // check if it’s in the array echo ‘<h5>Date ‘.$thisday.'</h5>’; // if not, print header with date $dates[] = $thisday; // and … Read more

Query Posts to fetch Posts with Unique Tag

<?php $arg = array(‘cat’ => ‘1’,’showposts’ => 10,’offset’ => 0); query_posts($arg); if (have_posts()) : while (have_posts()) : the_post(); ?> <a class=”post-link” title=”<?php the_title(); ?>” href=”https://wordpress.stackexchange.com/questions/55868/<?php the_permalink(); ?>”><?php the_title(); ?></a> <?php if (!$used_tags) $used_tags = array(); $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { if ( !in_array($tag->term_id, $used_tags) ) { array_push($used_tags, $tag->term_id); echo … Read more

Creating Custom Query

Try following codes: $country_search_array = array(); while($row = mysql_fetch_array($regionresult)){ $country_search_array[] = $row[‘country’]; // Your country field name } $country_search = “‘”.implode(“‘,”, $country_search_array).”‘”; $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘Country’, ‘value’ => $country_search, ‘compare’ => ‘IN’ ) ) ); $query = new WP_Query( $args );

WordPress Query Returning Every Post

Thanks for all of the help! It tured out to be a combination of issues: Instead of imploding the $country_search_array, it needs to be added as is to the query. Since it’s an array, we can’t use the ‘=’ for the compare value. It needs to be ‘IN’ I couldn’t have figured it out without … Read more

wp_pagenavi on WP_Query using customfields

Try this one you need to add ‘paged’ => get_query_var(‘page’) so your code in $my_query should be like this $my_query = new WP_Query(array( ‘post_type’=>’post’, ‘posts_per_page’=>’1’, ‘paged’ => get_query_var(‘paged’) )); You just need to pass along the ‘paged’ query var from the main query: You can see also Codex page on query_posts()

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