• Resolved DonTorpedo

    (@dontorpedo)


    Hello,

    I use wp-forge to build a one-page theme, and i use this code in the front-page template

    <?php
    if (($locations = get_nav_menu_locations()) && $locations['onepage_navi'] ) {
            $menu = wp_get_nav_menu_object( $locations['onepage_navi'] );
            $menu_items = wp_get_nav_menu_items($menu->term_id);
            $pageID = array();
            foreach($menu_items as $item) {
                if($item->object == 'page')
                    $pageID[] = $item->object_id;
            }
        query_posts( array( 'post_type' => 'page','post__in' => $pageID, 'posts_per_page' => count($pageID), 'orderby' => 'post__in' ) );
    }
    
            while(have_posts() ) : the_post();
    
    ?>
         <div id="<?php echo $post->post_name;?>"><?php get_template_part( 'content', 'page' ); ?></div>
    		<?php endwhile; // end of the loop. ?>
    
    	</div>

    all is working well, but it loads only the content of the pages, without the templates..

    how can i make it to load the pages in its own templates?

    can you give me a hint?

    thanks in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘One pager with wp forge’ is closed to new replies.