WordPress.org

Ready to get started?Download WordPress

Forums

Using Split Posts With More Tag (3 posts)

  1. checksum
    Member
    Posted 9 years ago #

    Hi, I'm currently using the following code in my index.php file to abbreviate posts in blog index view.
    <?php if(is_single()) {
    the_content();
    } else {
    the_excerpt();
    } ?>

    I would however like to make use of the "Split Posts With More Tag" option which requires this code:

    <?php the_content(__('(more...)')); ?>

    How can I combine the two? As my simplistic php code doesn't work :(

    <?php if(is_single()) {
    the_content(__('(more...)'));
    } else {
    the_excerpt(__('(more...)'));
    } ?>

    Thanks

  2. iand
    Member
    Posted 9 years ago #

    Try
    <?php if(is_single()) {
    the_content(__('(more...)'));
    } else {
    the_excerpt();
    } ?>

    instead. the_excerpt does not have any parameters:
    Template_Tags/the_content
    Template_Tags/the_excerpt

    Also, the_content should default to (more...), so your orignal code should work fine.

  3. checksum
    Member
    Posted 9 years ago #

    I had already tried this:

    <?php if(is_single()) {
    the_content(__('(more...)'));
    } else {
    the_excerpt();
    } ?>

    "Also, the_content should default to (more...), so your orignal code should work fine."

    It's not working, If I replace my code with:

    <?php the_content(__('(more...)')); ?>

    It works. Peculiar.

Topic Closed

This topic has been closed to new replies.

About this Topic