WordPress.org

Support

Support » How-To and Troubleshooting » Content won't display on custom page template

Content won't display on custom page template

Viewing 11 replies - 1 through 11 (of 11 total)
  • He Styletheology

    Have you published the post as I get an error that reads “You do not have permission to preview drafts.” when I click on the link you shared. I think you are talking about http://www.styletheology.com/?page_id=61. Please confirm if this is correct.

    Yes, the page that I used to test the text was:

    http://www.styletheology.com/?page_id=61

    Hi styletheology,

    The problem is with your template code itself. You are forgetting to call the_content(). If you add a call to the_content(); into your template you should see the content of your page. Simple fix 🙂

    Hope this helps,

    -Greg J

    I added the line to the template code, but it still isn’t working:

    <?php
    /*
    Template Name: Blank Page 2
    */
    
    define('WP_USE_THEMES', false);
    require('wp-blog-header.php');
    get_header();
    get_sidebar();
    get_footer();
    
    the_content();
    
    ?>

    Am I missing something?

    You will probably want to move the call to the_content(); so that it is situated between get_header(); and get_sidebar();

    You also need to include the loop to make sure you have posts – http://codex.wordpress.org/The_Loop

    <?php if ( have_posts() ) : while( have_posts() ) : the_post();
         the_content();
    endwhile; endif; ?>

    ahhh, yes, I actually had this problem just yesterday when working on a custom home page template. NEVER forget the loops! gj Jarret

    Thanks, I got it to work now.

    Now if I could just figure out how to change the sidebar area from grey to white. I have gone through my style.css code backwards and forwards and I can’t figure it out. I have changed every sidebar background color to #ffffff, but it doesn’t change anything. Any ideas?

    There are 2 #container sections in your CSS.

    In each section, change

    background: url(images/bg-container.png) repeat-y;

    to

    background: #fff;

    Thank you, I finally got it working right for the colors. I noticed though that if I view the site on an ipad the content from the post area bleeds over into the side bar. Any ideas?

    You’ll need to read up on CSS Media Queries for that bit. It can be a bit hairy.

    Also I recommend reading up on Responsive Design.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Content won't display on custom page template’ is closed to new replies.
Skip to toolbar