Excerpts vs Full content display for Sparkling WordPress theme

Hello!

I just set an excerpt for a post on my WordPress blog. However, it does not appear on the actual website. Is there some kind of alternate setting I need to modify?

Thanks so much!

That setting that you can find under Settings - Reading - “For each article in a feed, show” is for RSS feed and not blog index page.

For Sparkling you have two options how you can use Excerpt (post summary):

  1. Add them for each post manually by using read more tag like it is described here.

  2. Or replace <?php the_content(); ?> that you can find in content.php file with <?php the_excerpt(); ?> That way all your posts will be shortened by default.

Aigars, I have the same problem but your solutions are not solving my dilemma.

For option 1: Adding more text to the <!–more–> tag does nothing. While the post shows up with the excerpt I entered, no text appears after the excerpt. The only thing to get the reader to the full entry is the “Read More” button that is at the bottom of the post. But that is not what I need.

For option 2: It works, but gives me the same look as option 1. With no indication that the post is truncated.

The only option I see is to manually type a link “Click to continue reading…” on every post. Which with many different contributors can becomes tedious. Any help?

smashcutculture.com

You can bring back default WordPress behavior by removing this line form content.php file

<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php _e( 'Read More', 'sparkling' ); ?></a></p>

That part generates read-more button on every post.

Now that you no longer have read more button at all you should add this code to Theme Options - Other - Custom CSS. Now you should see (more) when you use “More tag” for your posts.

.more-link {
  display: inline-block;
  margin: 0;
  float: none;
}

You can changed text that appears as (more) by replacing

<?php the_content(); ?>

On the same content.php file with code like this:

<?php the_content('continue reading…'); ?>

You can now use any text you want.

Also you can leave existing “Read More” button in place if you want and removing it is only optional.

Let me know if this is what you were looking for.

Aigars, you are truly the keymaster. Thank you very much for the help. Everything worked exactly how I hoped it would.

Hopefully, this ain’t pushing it - but any chance in being able to change the font color of the “continue reading…” tag on the article to distinguish it from the original text? Not a big deal, but would I figured I’d ask.

But thanks again either way!

No problem at all.

Add this code to Theme Options - Other - Custom CSS:

a.more-link {
  color: #D00;
}
a.more-link:hover {
  color: #fff;
}

The first part will change URL color and the second one will change color on hover since it makes a red background and text becomes unreadable. This code will turn text white on hover, so it will remain readable.

I wanted to keep the button, but only when I used the <!–more–> code in my posts.

I followed the above about removing the line from content.php and then added the following into functions.php

add_filter( 'the_content_more_link', 'modify_read_more_link' );
function modify_read_more_link() {
return '<a class="btn btn-default read-more" href="' . get_permalink() . '">Read More</a>';
}

This makes it so you have the same formatting but the button only appears when you want it to.