WordPress.org

Ready to get started?Download WordPress

Forums

Show the whole post in archive and not just an excerpt (9 posts)

  1. eagerwatcher
    Member
    Posted 3 years ago #

    Hi,

    I posted this question in a different category but got no bites, so I'm trying again, and supplying more info this time.

    It must be possible for my archives to show the whole post and not just an excerpt that shows a mixture of text and code.

    But how is it done?

    My theme is http://www.leadcamp.com/content/2009/07/16/world-of-business-free-wordpress-template-themes/ but the following will hopefully be helpful, and time-saving.

    There is no catalogues.php or loop.php

    archive.php = http://pastie.org/2017583

    archives.php = http://pastie.org/2017587

    functions.php = http://pastie.org/2017590

    index.php = http://pastie.org/2017596

    search.php = http://pastie.org/2017604

    single.php = http://pastie.org/2017606

    Thanks,

    Jane

  2. Digital Raindrops
    Member
    Posted 3 years ago #

    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

  3. alchymyth
    Forum Moderator
    Posted 3 years ago #

    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?

  4. eagerwatcher
    Member
    Posted 3 years ago #

    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

  5. Digital Raindrops
    Member
    Posted 3 years ago #

    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

  6. alchymyth
    Forum Moderator
    Posted 3 years ago #

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

  7. eagerwatcher
    Member
    Posted 3 years ago #

    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

  8. alchymyth
    Forum Moderator
    Posted 3 years ago #

    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.

  9. eagerwatcher
    Member
    Posted 3 years ago #

    Thanks ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic