Slick slider for post doesn’t display anything

look at this example structure : /** * Section Servises */ $servises_info = new WP_query(‘pagename=правни-услуги’); if ($servises_info -> have_posts() ) : while ( $servises_info -> have_posts() ) : $servises_info -> the_post(); // look hire below $relayted_post = new WP_query(‘cat=2&order=ASC’); /* Start the Loop two */ while($relayted_post -> have_posts()): $relayted_post -> the_post(); $servises_data = get_the_content(); // … Read more

Query for current post

You shouldn’t be writing any query. WordPress does this for you. You single-{post type}.php template should only contain the standard loop: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); // Display post content endwhile; endif; ?>

Get posts that match defined arrays of tags

This should be achievable with a taxonomy query, like this: $query = new WP_Query( [ ‘tax_query’ => [ ‘relation’ => ‘AND’, [ ‘taxonomy’ => ‘post_tag’, ‘terms’ => $platforms, ‘compare’ => ‘IN’, ], [ ‘taxonomy’ => ‘post_tag’, ‘terms’ => $hashtags, ‘compare’ => ‘IN’, ], ], ] ); You just need to substitute the $platforms and $hashtags … Read more

order posts by a secondary query that counts items

The way to go is apply custom filters to the WP_Query you are running. add_filter(‘posts_clauses’, function ($clauses, $query) { global $wpdb; // only run the filter for a given query // do your checks and return early if (!$query->is_main_query() || !$query->is_post_type_archive(‘tracklist’)) { return $clauses; } $clauses[‘fields’] .= “, COUNT(items.id) AS track_count”; $clauses[‘join’] .= ” LEFT … Read more