Skip to main content
deleted 85 characters in body
Source Link

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 by get_page()in my WP_Query same as the other pages.

Update with codeUpdated to use WP_Query rather get get_pages

    <?php

        $args = array (
        'sort_order' => 'ASC',
     'post_type' => 'page',
 'sort_column' => 'menu_order', //post_title
        'hierarchical''order' => 1'ASC',
        'child_of' => 0,
    'orderby' => 'menu_order',
  'parent' => -1,
        'offset''posts_per_page' => 05,
        'post_type' => 'page',);
  
       'post_status' =>$query 'publish'
= new WP_Query( $args ); 

    $pages = get_pages  if ($args $query->have_posts();
 ) {
    //start loop
    foreach   while ($pages as$query->have_posts() $page_data) {
        $content = apply_filters('the_content', $page_data     $query->post_content>the_post(); ?>
        $title = $page_data->post_title;
       
  $slug = $page_data->post_name;
    ?>

        <a data-magellan-destination="<?php echo "$slug"$post->post_name; ?>" name='<?php echo "$slug"$post->post_name; ?>'></a>
                <div id="<?php echo "$slug"$post->post_name; ?>" class="page-wrap full">
                    <h2><?php echo "$title"the_title() ?></h2>
                        <?php echo "$content"the_content() ?>
                </div> 

            <?php }
        } else {
    }

        wp_reset_postdata();
    ?>

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 by get_page().

Update with code

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

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.

Updated to use WP_Query rather get get_pages

    <?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();
    ?>
Tweeted twitter.com/#!/StackWordPress/status/503448127383539712
added 2 characters in body
Source Link

I'm creating a theme for my portfolio site. After a some time of trial and error research and almostsalmostss, 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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

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

I'm creating a theme for my portfolio site. After a some time of trial and error research and almosts 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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

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

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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

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

added 266 characters in body
Source Link

I'm creating a theme for my portfolio site. After a some time of trial and error research and almosts 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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

Has anyone come across this type of situation before? Or have any idea's wheream I missing something with my loop that would prevent the blog post from loading. I'm going wronglearning 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

I'm creating a theme for my portfolio site. After a some time of trial and error research and almosts 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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

Has anyone come across this type of situation before? Or have any idea's where I'm going wrong?

Thanks in advance

I'm creating a theme for my portfolio site. After a some time of trial and error research and almosts 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 by get_page().

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).

enter image description here

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.

Update with code

front-page.php

    <?php

    $args = array(
        'sort_order' => 'ASC',
        'sort_column' => 'menu_order', //post_title
        'hierarchical' => 1,
        'child_of' => 0,
        'parent' => -1,
        'offset' => 0,
        'post_type' => 'page',
        'post_status' => 'publish'
    );
    $pages = get_pages($args);

    //start loop
    foreach ($pages as $page_data) {
        $content = apply_filters('the_content', $page_data->post_content);
        $title = $page_data->post_title;
        $slug = $page_data->post_name;
    ?>

    <a data-magellan-destination="<?php echo "$slug" ?>" name='<?php echo "$slug" ?>'></a>
    <div id="<?php echo "$slug" ?>" class="page-wrap full">
        <h2><?php echo "$title" ?></h2>
            <?php echo "$content" ?>
    </div>
    <?php } ?>

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

added 802 characters in body
Source Link
Loading
Source Link
Loading