Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28145

    Gday Kriesi forum

    I’d like to automate excerpts on the archive page, rather than the default full post content.

    I did read a recent post that was in need of the same but the thread is closed and I didn’t understand the latter steps: https://kriesi.at/support/topic/enfold-archive-exceprts

    I placed the archive.php in my child theme includes folder, and modified line 47 to say get_template_part( ‘includes/loop’, ‘archive’ );

    But then I’m not sure what to do next. It seemed as though I need to also include the loop-index.php in the child includes and modify that. However, I don’t know what to do to modify that file.

    Does anyone know what I need to do here?

    Thanks for any help you can provide me.

    cheers

    Darryl

    #136641

    Hi Darryl,

    Once you’ve followed this step: https://kriesi.at/support/topic/enfold-archive-exceprts#post-120517

    If you are in a child theme need to create the includes folder and put the loop-archive.php in it. Now you can edit the loop-archive.php file and where it has the_content change it to the_excerpt.

    Regards,

    Devin

    #136642

    Thanks Devin

    I followed all the steps and it still delivers the full post. The files are setup in the right folders, I did a test by deliberately breaking the file and it showed an error on the website, so I know it is reading from it.

    This is the loop-index line 43 that I’ve edited to include the_excerpt:

    $current_post['content'] = str_replace(']]>', ']]>', apply_filters('the_excerpt', $current_post['content'] ));

    Should the second argument for ‘content’ be replaced with something else?

    cheers

    Darryl

    #136643

    You should not be needing to edit anything like that. The loop-archive.php has a single line that reads:

    the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> &rarr;</span>'); ?>

    To WordPress, this means spit out the content and if it has a more tag then break it off there. You need to change it to:

    the_excerpt(__('Read more','avia_framework').'<span class="more-link-arrow"> &rarr;</span>'); ?>

    Which instead attempts to grab the excerpt first.

    See: http://codex.wordpress.org/Function_Reference/the_excerpt

    The reason I wanted to re-point out this step: https://kriesi.at/support/topic/enfold-archive-exceprts#post-120517 is because you should be working in the loop-archive.php and not the loop-index.php after you make that change.

    #136644

    Thanks Devin, what a blunder…I totally had the wrong file. Thanks so much for your follow up, you are the best :)

    #136645

    No worries! Glad its working for you now :)

    Let us know if you have any other questions or issues.

    Regards,

    Devin

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Archive Excerpts’ is closed to new replies.