Show full post, not just excerpt (9 posts)

  1. HorrorUK
    Posted 4 years ago #

    I'm trying to show the full post in a section of my site, but can't get it to work for some reason.

    If I have <?php the_excerpt(); ?> it works fine, but If I change that to <?php the_content(); ?> It doesn't show the post content.

    On the page below, the first two entries are using the_excerpt, but the final four are using the_content. I've searched around the web, and the_content should be doing the job, so I'm not sure what's wrong.



  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

    can you paste the full code of that template into a http://pastebin.com/ and post the link to it here?

    and please say hello to Michael and Lynne from me -
    blessings, Michael

  3. HorrorUK
    Posted 4 years ago #

    Here is the link:

    I'll pass your greetings on to Mike & Lynn. I'm mainly working with Penny, and Elsa over the next few days as I've recently been added as a tutor. I'm sure I'll meet up with everybody else shortly though.

    Thank you for your help on this, and past problems. I have your site bookmarked now, as it is the perfect site for Avalonian WordPress nuts.

  4. HorrorUK
    Posted 4 years ago #

    I should add, that it is lines 22-55 that deal with the centre column.

  5. alchymyth
    Forum Moderator
    Posted 4 years ago #

    can you double check that is the right template you are working on?

    simply put something very obvious into the html code.

    (during programing and testing, i personally find it a good idea, to have the template name as a html comment at the beginning of the template.)

    despite having the_excerpt() in the code, the 'directors' are showing the full content text (unless you have set the excerpt to show more than the default 55 words).

    in the pasted code, there is the_excerpt() as well for the 'advisors' and showing nothing.

  6. HorrorUK
    Posted 4 years ago #

    For some reason, I'd copied/pasted during mid-edit. This is the section I'm dealing with:

    With the excerpt on the directors, I have placed the text into the excerpt box, bypassing the limit. This was more to see how things looked on the page.

  7. alchymyth
    Forum Moderator
    Posted 4 years ago #

    try without setup_postdata(); which you shouldn't have to use with a query; (the_post() would set the data, as far as i know)


  8. HorrorUK
    Posted 4 years ago #

    Thank you, that sorted it out.

    Strange, because I had to add setup_postdata(); on another section that wasn't working. I'm still learning this whole theme design lark :)

    I've passed your message on to Penny, and she is meeting up with Michael & Lynne tomorrow.

  9. alchymyth
    Forum Moderator
    Posted 4 years ago #

    great, thanks ;-)

    you would use setup_postdata() in a foreach loop for get_posts(), for instance.

Topic Closed

This topic has been closed to new replies.

About this Topic