• I was wondering if the preview for a post can be adjusted in length or if it’s based on the theme?.

    I would like to have a caption below each image show right before the ” Continue reading ” but it doesn’t quite fit.

    http://www.modernmanfitness.com/

    I have seen other blogs that appeared to have various post preview lengths ending right where they wanted.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • It can be theme specific via some code in functions.php:

    // Increase excerpt length
    function my_excerpt_length($length) {
    	return 100; // Or whatever you want the length to be.
    }
    add_filter('excerpt_length', 'my_excerpt_length');

    This will increase the standard excerpt of 55 words that is normally displayed by <?php the_excerpt();?> to 100 words.

    Thread Starter Trevoris

    (@trevoris)

    Esmi where might I find this piece of code to edit?.

    Thread Starter Trevoris

    (@trevoris)

    I can find something similar in functions.php not sure exactly what to add .

    Your functions file should be located at http://www.modernmanfitness.com/wp-content/themes/vesper/functions.php. You would can use the editor in the WordPress admin page, or use your own text editor to make the change. Simply copy and past the code that esmi gave to you, replacing the 100 in the line return 100; with the number of words you want in your excerpts.

    Check out these pages for more details:

    the_excerpt
    excerpt_length

    Thread Starter Trevoris

    (@trevoris)

    Thanks Jpry,

    A quick question if anyone can answer. http://fitnessblackbook.com/ every post on this site ends right where he wants it to end in the preview. And after looking at word counts there sometimes 50-60 more or less words difference.

    Does a plugin do this perhaps? It’s what im looking to do, but I assumed it was based on just word amounts.

    Thanks.

    It’s very possible that they enter a custom excerpt for each post. There is an excerpt box right beneath the main content box when editing a post.

    Another possibility is that they have a plugin that simply uses the first full paragraph as an excerpt. I haven’t searched through the plugins to see if there is one that does that, but I wouldn’t be surprised if there are a few.

    Thread Starter Trevoris

    (@trevoris)

    Thanks man. I’ll take a look and see what the options might be. Appreciate the help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Can you adjust posts preview length?’ is closed to new replies.