• I can’t get the whole content of my post to display on my main page. Here is the code I am using to call for the posts, unsuccesfully:

    <?php query_posts('category_name=features'); ?>
    <table border="0" width="100%">
    <tr>
    <td><h9>" title="<?php the_time('l j F Y H:i') ?>"><?php the_title() ?></h9></td>
    </tr>
    <tr>
    <td align="justify"><div class="entry">

    <?php the_content() ?>

    </div></td>
    </tr>
    </table>

    The page where this code is implemented is https://www.btccaction.co.uk. For the time being, to avoid leaving it empty, the page is displaying the exact code as above apart from I’ve replaced the_content with the_excerpt

    Please help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • So that code works for the_excerpt but not for the_content? I have to ask: have you typed something into the “Post” box for your entries? I’m thinking that maybe you’ve only written something in the “Optional Excerpt” box.

    And where’s the first part of your loop, this bit:
    <?php if (have_posts()) : while (have_posts()) : the_post();

    Should your first line look like this:
    <?php if (have_posts()) : query_posts($query_string . '&category_name=features'); while (have_posts()) : the_post();

    That’s similar to what I do to exclude a certain category from my main loop.

    Thread Starter andyspeed

    (@andyspeed)

    I have posts content – remember, this isn’t the ‘Single post’ page I’m editing but the main site front page.

    Your code doesn’t help…yet. When I use it I get the error ‘Parse error: parse error, unexpected $ in /…/wp-content/themes/fast-lane/features.php on line 14’

    Where the file in question contains the following code:
    <?php if (have_posts()) : query_posts($query_string . '&category_name=features'); while (have_posts()) : the_post(); ?>

    <table border="0" width="100%">
    <tr>
    <td><h9>" title="<?php the_time('l j F Y H:i') ?>"><?php the_title() ?></h9></td>
    </tr>
    <tr>
    <td align="justify"><div class="entry">

    <?php the_content(); ?>

    </div></td>
    </tr>
    </table>

    (It is such a small file as it is included in the main page using a php_include)

    I have tried putting <?php endif; ?> on the end but this also doesn’t work.

    ??!??!??

    Yeah, main page, got it. That’s the code from my main page. What’s the code for feature.php and the code for index.php? I think, since you’re dealing with a combo of those two pages, we need to see all the code.

    Something’s happening to your code as you paste it here (one of the frustrations of this forum). I don’t think all of it is coming through. Try posting the main index page and that feature page as text files somewhere (or just change the extensions to “phps”) so we can look at it. Another option is to use a pastebin, something this forum should really have built into it.

    Also, what if you use another template? Does the_content display? If so, you know you’ve got a template issue. If not, you know you have a database issue. Try another template and see what happens to your content.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show post’ is closed to new replies.