• Resolved Nikelaos

    (@nikelaos)


    Hello again, @archetyped!

    Now I am going to use your plugin – but I can’t get it to do the thing, that I want.

    If I edit page.php in the way it’s shown in https://archetyped.com/know/how-to-organize-posts-in-sections-in-wordpress-with-cornerstone/, I see my posts in the sections as I have assigned them – but the pages I have in my site are just empty.

    So I’m a bit in trouble now. Cause I need my pages. It seems to me, as the way to do this is, to put my pages as posts, create for each post a single section-page and then I assign the post to that. Is this the idea? Hmmm… I don’t know…

    Can you give me hand? And your other I need too, I guess: I don’t know how to code the page.php-template, if I want to show single posts as well as summary of the posts, which are assigned to a section. In the case of an overview I just want to show the start of the post – therfore I use the “Advanced Excerpt”-Plugin by WPKobe, but it seems to me, that doesn’t work when on section-pages…

    Can you help me, please?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, I’m not quite following the issue you are experiencing. Can you please provide the following and I would be glad to take a closer look:

    • A link to a page that exhibits the issue you are experiencing.
    • Original page.php code (before modifications).
    • Your current page.php code.

    Note: See here for instructions on posting code examples.

    Thanks.

    Thread Starter Nikelaos

    (@nikelaos)

    OK, @archetyped , nevermind, my english is not the best…

    First the code in my page.php (I use a child of the twentyfifteen-theme):

    get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main tpl_page" role="main">
    
    		<?php
    		// Start the loop.
    		/*while ( have_posts() ) :
    			the_post();*/
          while ( cnr_have_children() ) :
             cnr_next_child();
    
    			// Include the page content template.
    			get_template_part( 'content', 'page' );
    
    			// If comments are open or we have at least one comment, load up the comment template.
    			if ( comments_open() || get_comments_number() ) :
    				comments_template();
    			endif;
    
    			// End the loop.
    		endwhile;
    		?>
    
    		</main><!-- .site-main -->
    	</div><!-- .content-area -->
    
    <?php get_footer(); ?>

    You see, I’ve just commented the WP-loop…

    To see the effects with WP-Loop/Cornerstone-loop please visit:
    https://soetso.de/loremipsum-1 (WP-Loop)
    https://soetso.de/loremipsum-2 (CNR-Loop)
    You can switch between the sites by the menu.

    And as you can see: The ?Frontpage‘ isn’t shown when the CNR-Loop is active. (Sure, that’s a special page, but ?normal‘ pages are also not shown…)

    Hope that will help and thanks for your support!

    Thread Starter Nikelaos

    (@nikelaos)

    Ok, well, might be that I was a bit silly…

    The solution of my issue is as quite simple as ist can be:

    * In my theme-child-folder, I copied page.php (or any other standard-template that is wanted to be used) to sectionpage.php

    * I edit sectionpage.php and add /* Template Name: Sectionpage */ in the first line.

    * Then I change the wp-loop to the cornerstone-loop

    * Last step: On the page, that should be used as sectionpage, select ?Sectionpage“ from the list of templates in the page attributes.

    Saved the page an now it works as I expected.

    So simple…

    Plugin Author Archetyped

    (@archetyped)

    Thank you for the additional details. The page’s own content is not being displayed because you have replaced the template’s original loop with the CNR loop.

    As per the tutorial you linked to in your first post, the CNR loop should be added to the page template where you want the section’s posts to be displayed. The only time you would replace existing code from the template is when you no longer want to display some content.

    My recommendation would be to revert the changes you made to the original post loop in the page template, and then add CNR’s loop after the page’s own content has been output.

    This will allow you to use a single template (e.g. page.php) for all pages, regardless of whether they have posts or not.

    Thread Starter Nikelaos

    (@nikelaos)

    Thank you very much, @archetyped , the greatness of your plugin becomes clearer now to me. That’s really a usefull plugin!

    So I missunderstood the tutorial and that’s in first a problem of my english. I hope that did not cause any inconvenience…

    Plugin Author Archetyped

    (@archetyped)

    Glad to hear you got things working as desired! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pages aren’t shown’ is closed to new replies.