I have built a template and two partials in WordPress (php). In the template I use get_template_part() two times but only the first one is loaded.

    <div class="partial_blockarticle">
    <div class="partial_interview">

In this example, the blockarticles are loaded but no interview. If I switch the divs, only interviews are loaded.

The blockarticles/interviews are Custom Fields and are loaded in the partials like this:

    $pageID = $post->ID;
    // Build WP_Query() argument array
        $news = new WP_Query(array(
            'posts_per_page' => 6,
            'post_type' => 'blockarticles',
            'order' => 'desc',
            'orderby' => 'date',
            'meta_key' => 'blockarticle_page_parent',
            'meta_value' => $pageID 
        while($news->have_posts()): $news->the_post();
    //Do stuff

What am I doing wrong here? $news can not be empty since it shows both articles and interview when I switch place?

Read more here: Include several partials in a wordpress template. Showing only one of them


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: