• Resolved crankybeardesign

    (@crankybeardesign)


    I have a custom page with only minor changes from the index, but I can’t get it to show the page content—that is, the text I’ve entered in the visual editor for the page. Instead, all of my blog posts show up.

    How can I get it to show the page content, and not the posts?

    Thanks!

    Here’s the code of the page template, which I assume is the issue:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <?php
    /*
    Template Name: Calendar
    */
    // Which page of the blog are we on?
    $paged = get_query_var('paged');
    query_posts('cat=-0&paged='.$paged); ?>
    <?php get_header(); ?>
    <div id="meat">
    	<div id="navmenu" title="Navigation Menu">
    		<div id="navmenu_ads">Testing out possible ad space</div>
    		<ul id="navlist">
    			<li id="button_back"><a href="https://ampyknight.com/wordpress"><div class="navlink_text">Blog</div></a></li>
    			<li id="button_front"><a href="#top"><div class="navlink_text">Race Calendar</div></a></li>
    			<li id="button_back"><a href="#top"><div class="navlink_text">Training Chart</div></a></li>
    			<li id="button_back"><a href="#top"><div class="navlink_text">Equipment</div></a></li>
    		</ul>
    	</div>
    	<div id="loopandbar">
    		<div id="loop_column">
    			<div id="loop_actual">
    				<?php include (TEMPLATEPATH . '/theloop.php'); ?>
    				<div id="comments_section">
    					<?php comments_template(); ?>
    				</div>
    			</div>
    		</div>
    		<div id="sidebar">
    			<?php get_sidebar(); ?>
    		</div>
    	</div>
    </div>
    <?php get_footer(); ?>
    </body>
    </html>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Don’t know what theloop.php is doing, but if that Template (Template Name: Calendar) is assigned to the Page, then you don’t really need:

    // Which page of the blog are we on?
    $paged = get_query_var('paged');
    query_posts('cat=-0&paged='.$paged); ?>

    because WordPress will automatically do the query for you. You just need a loop to display it.

    Thread Starter crankybeardesign

    (@crankybeardesign)

    That has solved the problem! Just deleting that query. I’m not exactly boss at php, so I had that in there based on a tutorial I once read.

    I was seriously about to kick a puppy over this, so I can’t thank you enough. I owe you some cookies or something.

    “theloop.php” is just where I keep my loop code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom page not showing page content (showing blog posts instead)’ is closed to new replies.