• Hello,

    I am building a wordpress site from scratch and I’ve created a few pages to start with. On the dashboard I’ve added a little bit of text on each page to make sure the page show up with the text there. I go to look at each page after writing some text into the box and then hitting “update,” but the text doesn’t show up in the live version of each page. How do I correct this?

    Thanks,

    Rob

Viewing 10 replies - 1 through 10 (of 10 total)
  • URL please.

    Where exactly does the text appear in the code? Inside which tags?

    Thread Starter RoanokeVaGuy

    (@roanokevaguy)

    Which template of the site should I put here to show that?

    Please post a url. And what theme are you using?

    Thread Starter RoanokeVaGuy

    (@roanokevaguy)

    https://starcitycreations.com/testing/

    This is a theme I am trying to create from scratch.

    C W (VYSO)

    (@cyril-washbrook)

    Let’s start with the basics, then.

    (1) Do you have a correctly formed instance of the Loop in the relevant template file?

    (2) Have you included the_content() within the Loop?

    Thread Starter RoanokeVaGuy

    (@roanokevaguy)

    Here is what my index.php code looks like:

    `<?php get_header(); ?>
    <div id=”main”>
    <div id=”content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1><?php the_title(); ?></h1>
    <h4>Posted on <?php the_time(‘F jS, Y’) ?></h4>
    <p><?php the_content(__(‘(more…)’)); ?></p>
    <hr> <?php endwhile; else: ?>
    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p><?php endif; ?>
    </div>
    <?php get_sidebar(); ?>
    </div>
    <div id=”delimiter”>
    </div>
    <?php get_footer(); ?>

    C W (VYSO)

    (@cyril-washbrook)

    If that’s so, then it’s safe to say that none of the pages at the link you’ve provided is generated by the index.php template. What does your page.php template look like?

    Thread Starter RoanokeVaGuy

    (@roanokevaguy)

    Here it is:

    `<?php
    /**
    * The template for displaying all pages.
    *
    * This is the template that displays all pages by default.
    * Please note that this is the WordPress construct of pages
    * and that other ‘pages’ on your WordPress site will use a
    * different template.
    *
    * @package WordPress
    * @subpackage Star City Creations
    * @since Star City Creations 1.0
    */

    get_header(); ?>

    <div id=”primary”>
    <div id=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php comments_template( ”, true ); ?>

    <?php endwhile; // end of the loop. ?>

    </div><!– #main –>
    </div><!– #primary –>

    <?php get_footer(); ?>

    C W (VYSO)

    (@cyril-washbrook)

    What’s important when trying to build or edit a theme is to understand which templates are being used and what those templates are actually doing.

    In your case, each page that you are creating relies by default on the page.php template, which in turn loops content based on the results of this function:

    <?php get_template_part( 'content', 'page' ); ?>

    Assuming that all your pages are in fact relying on the page.php template, it seems clear from your testing pages that get_template_part() is not turning up anything. See the Codex page for information about how get_template_part() works.

    You need to ask yourself if there is a content-page.php, and if so, whether it includes the_content() (or indeed anything at all). If there is no content-page.php, then you need to ask yourself if there is a content.php, and if so, whether it includes the_content() (or indeed anything at all).

    If the answer to each of the above questions is “no”, then you have the answer for why nothing appears on your pages.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Can't get page text content to show up’ is closed to new replies.