WordPress.org

Ready to get started?Download WordPress

Forums

the_content(); Not Showing When Logged In (7 posts)

  1. mattblank
    Member
    Posted 1 year ago #

    Pretty much as the title explains.

    If I'm logged into my admin, and then view my site, the pages which have specific templates that have the_content(); among other code I've put in the page, shows everything except for the the_content();

    HOWEVER if I log out of admin and view it like a regular user, then the_content(); shows.

    Any suggestions? It's getting frustrating I need to constantly log in and out.

    Thanks!
    Matt

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Sounds like there's an issue in your custom template files based on is_user_logged_in or similar.

  3. mattblank
    Member
    Posted 1 year ago #

    My template simply consists of this though, and nothing shows in the_content area. What file do I need to look at?:

    <?php
    /*
    Template Name: Contact
    */
    
    get_header(); ?>
    
    <div id="left">
    
    		<h1 class="maintitle"><?php the_title(); ?></h1>
    
    		<?php the_content(); ?>
    
    </div> <!-- end of left -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  4. esmi
    Forum Moderator
    Posted 1 year ago #

    If that's the code for your custom template, then why would the page(s) display anything other than the_content()? What else are you doing?

  5. wpcanyon
    Member
    Posted 1 year ago #

    After get_header() put this...

    the_post();
  6. mattblank
    Member
    Posted 1 year ago #

    There was some blurb in there, but I took it out just to show the skin and bones of the template :)

    wpcanyon you've solved it!! :) Thanks so much.

    Matt

  7. wpcanyon
    Member
    Posted 1 year ago #

    You're welcome :)

Topic Closed

This topic has been closed to new replies.

About this Topic