Loop through two different sets of custom fields

Your question literally doesn’t quite sound like “combining” loops, that’s usually different thing in WP terminology. Following it literally you already know the part that outputs artist name you want — the_field(‘artist_name’). What probably confuses it in first context is that it’s not really a normal WP loop. Note how that call doesn’t specify which … Read more

Post Loop not Returning Permalink

You have made the mistake in getting the post link in your code. Missing <?php global $post; ?> – Initialization at the start of the loop After setting up the post data your query becomes like normal Wp_Query so that you can get the permalink() in normal method itself using the_permalink() instead of get_permalink($post->id). Since … Read more

Paginate get related post by author function

As I already stated in a comment to your answer, you should never make use of query_posts Note: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of … Read more

How to get posts without author?

That won’t be as easy as you’d like to… get_posts uses WP_Query to get posts and if you take a look at WP_Query code, ten you’ll see, that 0 is used as empty in there (https://core.trac.wordpress.org/browser/tags/5.0.3/src/wp-includes/class-wp-query.php#L2052): if ( ! empty( $q[‘author’] ) && $q[‘author’] != ‘0’ ) { It means, that you can’t pass ‘author’ … Read more

Problem with get_posts, tax_query and counting the number of posts

Try this again removing operator and relation arguments as follows: here is a useful link http://ottopress.com/2010/wordpress-3-1-advanced-taxonomy-queries/ $products = get_posts(array( ‘post_type’ => ‘products’, ‘posts_per_page’ => -1, ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘collection’, ‘field’ => ‘slug’, ‘terms’ => array($current_collection) ), array( ‘taxonomy’ => ‘type’, ‘field’ => ‘slug’, ‘terms’ => array($current_type) ), array( ‘taxonomy’ … Read more

get_posts only children from certain parents

You have two options: Call get_posts multiple times: one for the parent pages using post__in => array(2,4), and two for the child pages of each parent with post_parent => 2 and post_parent => 4 and finally merge all the results into a single array. Write directly your SQL query and use $wpdb->get_results. See this article … Read more

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