I'm creating a theme for my portfolio site. After a some time of trial and error research and almostss, I'm stuck.
It's going to be very minimal site in content, therefore I decided to create a one page website. I'm using get_pages($args);
to display each page in my front-page.php file.
This works great. Now here's where I'm stuck...I'd like to use a page to display my blog posts, which would be included in my one page flow and be called in my WP_Query same as the other pages.
So far I've tried the most documented method I can find; which is to change the page that's used to display posts in Settings>Reading.
To confirm
I have a static home page (front-page.php) which I've made a page template declared it in a page called home. Enabling me to set it in the reading settings, and I've created a page called blog for the same reason(this has template set to defualt).
My posts are not being loaded into the blog page set here.
I've read that a custom query could be interfering but I've checked this and it isn't the case in my situation.
Updated to use WP_Query rather get get_pages
front-page.php
<?php
$args = array (
'post_type' => 'page',
'order' => 'ASC',
'orderby' => 'menu_order',
'posts_per_page' => 5,
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post(); ?>
<a data-magellan-destination="<?php echo $post->post_name; ?>" name='<?php echo $post->post_name; ?>'></a>
<div id="<?php echo $post->post_name; ?>" class="page-wrap full">
<h2><?php the_title() ?></h2>
<?php the_content() ?>
</div>
<?php }
} else {
}
wp_reset_postdata();
?>
Has anyone come across this type of situation before? Or am I missing something with my loop that would prevent the blog post from loading. I'm learning php and WordPress and hit my limit of experience. I think the call to the content of the blog page itself is preventing the post information to come through? I'm not sure. Any guidance would be appreciated.
Thanks in advance