0

How can i display multiple posts and posts content on a single URL. Like this https://www.recruitment.guru/ssc/ssc-recruitment/ showing posts on single post page.

Please suggest a solution.

1 Answer 1

0

First you will need to create a custom page template and copy the styling from your page.php file. After that, you will use a loop below to display all posts in one page.###

<?php 
// the query
$wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1)); ?>

<?php if ( $wpb_all_query->have_posts() ) : ?>

<ul>

    <!-- the loop -->
    <?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    <!-- end of the loop -->

</ul>

    <?php wp_reset_postdata(); ?>

<?php else : ?>
    <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
1
  • Create a category page in your theme and assign the category when publish new post. After that get all the posts of the category by coding in category page by using wp-query. Let me know if you need help regarding this
    – HeroWeb512
    Nov 15, 2017 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.