0
votes

Currently I am trying to develop wordpress one page portfolio theme. Now it shows blog posts and page posts. I have created a custom page template for displaying one page portfolio items. It will display post from those pages which user will create from theme menu. Now I need to create that, but I have no idea how to do that. Please note that it will display only those page posts which user created from theme menu , and it will show those page navigation link(although I dont need any help about that , but I need help to show pages post) , and another thing is that , it will not display blog posts.

1
The theme will need to register a custom post type. Then you can just display posts with that post type.Chris Herbert

1 Answers

1
votes

Run a WP_Query on your index page, and inside the loop add the page contents

<?php $args = array(
        'post_type' => 'page', // Calling pages only
        'order' => 'ASC',
        'posts_per_page'=> '-1',  // display all pages published
    );

$loop = new WP_Query( $args ); if( $loop->have_posts() ): while( $loop->have_posts() ): $loop->the_post();?>

<?php the_title(); //Page Contents etc.?>

<?php endwhile; endif; wp_reset_postdata();?>