WordPress.org

Forums

[resolved] changing excerpt to full post (6 posts)

  1. storyboutagirl
    Member
    Posted 1 year ago #

    I have searched (http://wordpress.org/support/topic/a-problem-showing-full-posts?replies=9) and find tons of posts on this but they all say the same thing. To go to search.php and find <? php the_excerpt(); ?> and change it to <? php the_content(); ?> in the Loop. When I find <?php /* Start the Loop */ ?> it has this in it instead <?php while ( have_posts() ) : the_post(); ?> I can only assume one of the WP updates changed this somehow? How do I see the full post and not just an exceprt? Is there something I add to this? It's happening the same with categories and archives. If I do replace it with <? php the_content(); ?> then I get nothing but the title of the post repeated over and over and over again. Can someone tell me how to fix this or even where in the docs to find this?

  2. equalmark
    Member
    Posted 1 year ago #

    The code you have mentioned is the start of the WordPress loop:

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

    Just after that you will probably have some code that includes the_title() and after than the_content().

    To display the full articles you will need to replace the_content() with the_exceprt(). This will need to be done on all template you require this to happen e.g. archives.php

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    more recent themes might have this code in loop.php (twenty ten and themes inspired by it) or content.php (twenty eleven) or totaly somewhere else.

    without knowing what theme you are using, any detailed suggestions are difficult to make.

  4. storyboutagirl
    Member
    Posted 1 year ago #

    The theme is Yoko: http://wordpress.org/extend/themes/yoko

    This is the search.php file:

    [code moderated per forum rules - please follow http://codex.wordpress.org/Forum_Welcome#Posting_Code for posting code]

    I only see <?php get_template_part( 'content', 'search' ); ?> that has the word content in it...

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    this line:

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

    points to a template called content-search.php, or if this does not exist, content.php

    http://codex.wordpress.org/Function_Reference/get_template_part

    if yoko is build similar to twenty eleven, there will be a conditional statement with: if( is_search() ) that selects the excerpt for search results, and the full post for other pages.

  6. storyboutagirl
    Member
    Posted 1 year ago #

    Got it! Thanks it was in the content.php! Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic