• deepakbhatt619

    (@deepakbhatt619)


    hi i made a custom post type products.. now i want to show all of the custom posts in a single page..want to link all custom posts in a page

    i made a product-template.php template file and tried this query

    <?php
    $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
    the_title();
    echo ‘<div class=”entry-content”>’;
    the_content();
    echo ‘</div>’;
    endwhile;
    ?>

    aftr using this query i’m getting the posts bt only text contents not all post layout including featured image and layout
    please help me out i’m new

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    (@alchymyth)

    this part the_content(); only gives you the text content;

    for featured images and the layout, you will possibly need to copy more of the coding from your theme’s index template into your custom code.

    what theme are you using?

    Thread Starter deepakbhatt619

    (@deepakbhatt619)

    i’m using a themeum product prolog theme

    Michael

    (@alchymyth)

    your currently used theme does not seem to be one of the supported themes from https://wordpress.org/themes/
    – you might need to contact the theme’s developer for help with your question.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Get custom post query problem’ is closed to new replies.