WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Forward/Back buttons missing in custom template (3 posts)

  1. SeaBerGBer
    Member
    Posted 1 year ago #

    I finally figured out how to make pages that only display certain content. Now, those pages (and those pages only will not display the "Older Posts"/"Newer Posts" buttons anymore. The code is nearly identical so I don't understand why that would be.

    My original page.php reads:

    <?php get_header(); ?>
    
    		<div id="main" role="main" class="<?php brunelleschi_content_class(); ?>">
    
    			<?php get_template_part( 'loop', 'page' ); ?>
    
    		</div><!-- #main -->
    <?php if( brunelleschi_options('sidebar') === __('both','brunelleschi')
    		|| brunelleschi_options('sidebar') === __('two left','brunelleschi')
    		|| brunelleschi_options('sidebar') === __('two right','brunelleschi')){
    			get_sidebar('secondary');
    		} ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    My code for my custom page reads:

    <?php /* Template Name: DIY */ ?>
    
    <?php get_header(); ?>
    
    		<div id="main" role="main" class="<?php brunelleschi_content_class(); ?>">
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>
    
    <?php query_posts('category_name=DIY (Mine)');?>
    
    			<?php get_template_part( 'loop', 'page' ); ?>
    
    		</div><!-- #main -->
    <?php if( brunelleschi_options('sidebar') === __('both','brunelleschi')
    		|| brunelleschi_options('sidebar') === __('two left','brunelleschi')
    		|| brunelleschi_options('sidebar') === __('two right','brunelleschi')){
    			get_sidebar('secondary');
    		} ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    So all I added was:
    The template name to the top

    The code to display page content before querying the posts.
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

    And the bit to query the specific posts
    <?php query_posts('category_name=DIY (Mine)');?>

    What am I missing that could be removing the page navigation buttons?

    My page is http://www.acoloradocourtship.com and this template pertains to the "DIY" menu option. My theme is brunelleschi.

    Thank you! <3

  2. SeaBerGBer
    Member
    Posted 1 year ago #

    Ok. I had to revert my page to not display my custom menu pages. You can see the page in question here:

    http://www.acoloradocourtship.com/diy/

  3. SeaBerGBer
    Member
    Posted 1 year ago #

    Resolved

Topic Closed

This topic has been closed to new replies.

About this Topic