how to add limit records in wordpress query

What you want to do, can be achieved by means of the WP_Query class. $query = new WP_Query(array( ‘post_type’ => ‘quote2’, ‘posts_per_page’ => 10, // or something else )); Now you can work with $query like: if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post; ?> <h1><?php the_title(); </h1> <?php the_content(); <?php } else { // No … Read more

Edit WordPress loop, taxonomies, & filter

Your code makes it hard for anyone to help you. It is important to properly edit your code in your question. You really don’t have to use the amount of echo‘s you are using. It is just poor formatting and poor use of proper tags. You can clean up your code by just properly opening … Read more

WP_Query with tax_query not working

SQL query forming is wrong SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND 0 = 1 AND wp_posts.post_type=”product” AND (wp_posts.post_status=”publish”) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 1 Here 1=1 AND 0 = 1

Query custom post types by meta field in a term from custom taxonomy

Assuming that the query works and you get all posts with ss_category terms (instead of those with ss_aff_category = true only), I think this should work: $args = array( ‘post_type’ => array(‘advertisers_cats’), ‘posts_per_page’ => 9, ‘tax_query’ => array( array( ‘taxonomy’ => ‘ss_category’, ‘terms’ => array(100, 101), ‘field’ => ‘term_id’, ) ), ‘meta_query’ => array( array( … Read more

Standard Loop – wp_query

Yes you need some arguments defined. A good place to easily get your loops defined is: https://generatewp.com/wp_query/ Here’s an example of some arguments used. // WP_Query arguments $args = array ( ‘post_type’ => array( ‘post’ ), ‘nopaging’ => true, ‘posts_per_page’ => ‘3’, ‘ignore_sticky_posts’ => true, ); // The Query $query = new WP_Query( $args ); … Read more

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