Support » Themes and Templates » Show the whole post in archive and not just an excerpt

Viewing 8 replies - 1 through 8 (of 8 total)
  • That would be archive.php

    About Line 120:

    <div class="PostContent">
    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>

    Try changing the second line, if the post has a <!–more–> tag in the content, then that is what the content will show for the full post, text and then ‘Read the rest of this entry »’, so removing that option should work:

    <div class="PostContent">
    <?php if (is_search()) the_excerpt(); else the_content(); ?>

    alcymyth,
    We posted the same time, I was assuming that there are ‘more tags’ in the posts causing the issue with my reply.

    If not then the list should not be returned as a search is_search(), and if there are no ‘more tags’ full posts should be shown.

    Info:
    It is my understanding of the_excerpt(); vs the_content(__('Read the rest of this entry »', 'kubrick')); if the more tag is present in the content, then the text of the post upto the more tag is shown in the list view with the ‘read more’, that is what I use to control the excerpt’s displayed on my website.

    HTH

    David

    Michael

    (@alchymyth)

    Forum Moderator

    according to the code of archive.php, the theme should be showing the full post in archve pages:

    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry &raquo;', 'kubrick')); ?>

    can you post a link to your site?

    sometimes, these things are caused by plugins –
    have you tried to deactivate all plugins, to see if that solves the problem?

    Thank you Digital Raindrops and alchymyth for the fast replies.

    I made the change suggested by Digital Raindrops but I still get http://www.ourchangingglobe.com/?s=strauss-kahn&search=

    I haven’t yet tried disabling all the plug-ins but will do it if I have to 🙁

    Jane

    Hi Jane,
    That is because it is a search for ‘strauss-kahn’ see in the link.

    ?s=strauss-kahn&search=

    So WordPress is using the is_search() part and returning the_excerpt()

    Change to ignore the search part:

    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>

    To:

    <?php the_content(__('Read the rest of this entry »', 'kubrick')); ?>

    That will mean you can still use the contents more tag to shorten long posts!

    HTH

    David

    Michael

    (@alchymyth)

    Forum Moderator

    this topic shows how important it is to post a link to the problem.

    Thank you all!

    Everything is working OK now!

    I also changed the code in seach.php – should I have done so?

    @alchymyth – Yes, I should have posted a link but I’m always concerned that I don’t want it to look like I’m spamming.

    I should also have posted this to “themes” the first time, and not to “how to”.

    Jane

    Michael

    (@alchymyth)

    Forum Moderator

    no problem 😉

    it does not matter too much where you post a new topic – all sub-forums get equal attention; and in extreme, a moderator would simply move the topic.

    also, spamming would only be to post a link that is unrelated to the problem; and when someone is trying to promote his/her own business.

    Thanks 😉

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Show the whole post in archive and not just an excerpt’ is closed to new replies.