Optimising specific Query with ACF meta objects
Optimising specific Query with ACF meta objects
Optimising specific Query with ACF meta objects
thanks for responses, Allowed me to find correct answer which I’ve posted below – $tickets_for_user = get_posts(array( ‘post_type’ => ‘ticket’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘event_date’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 1, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘event_date’, ‘value’ => array($today,’20991231′), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘DATE’, ), array( ‘key’ => … Read more
wp_query – Modify $query to include duplicate content
Pagination not working in custom post page
Ajax Form data is not posted back to the get_results()
It might be not your case but if behind the scene permalink settings have been switched from default one, then the request: ?category_name=slug1+slug2 is rewritten to /category/slug1/ or /category/slug2/ so only the posts from one category are shown.
Note that this part: ‘post_status’ => ‘published’, should be: ‘post_status’ => ‘publish’, You can then try the following: $args = array( ‘post_type’ => ‘gutschein’, ‘pagination’ => true, ‘posts_per_page’ => ’10’, ‘posts_per_archive_page’ => ’10’, ‘ignore_sticky_posts’ => false, ‘post_status’ => ‘publish’, ‘paged’ => $paged, ‘meta_key’ => ‘unixendet’, ); add_filter( ‘posts_orderby’, ’emti_orderby’ ); $q = new WP_Query( $args … Read more
If you are trying to omit posts 1,3,5 from category 3 on your blog, you can use the following code $query = new WP_Query( array(‘cat’ => 3, ‘post_type’ => ‘post’, ‘post__not_in’ => array(1,3,5) ) ); The query results will not show posts with ids 1,3,5 of category 3.
I figured it out <?php $args = array( ‘post_type’ => array(‘post’, ‘music-videos’), ‘posts_per_page’ => 5, ‘orderby’ => ‘menu_order post_date’, ); $loop = new WP_Query( $args ); ?> <div id=”example1″ class=”slider-pro”> <div class=”sp-slides”> <div class=”sp-thumbnails” > <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class=”sp-slide”> <div class=”sp-image”> <a href=”https://wordpress.stackexchange.com/questions/181352/<?php the_permalink() ?>” title=”<?php the_title_attribute(); ?>”> <?php … Read more
The global $wp_query (in this case its the $query var) holds the $current_post which is available in the loop and tells the index of the current post ( $wp_query->current_post ). The $wp_query->post_count tells the number of posts being displayed in the loop, and this actually becomes a simple arithmetic solution that will work no matter … Read more