Support » Plugins » Post length on front page

  • There is a setting for the length of post to show on the front page.

    Max 50 words, filtered
    Max 100 words, filtered

    I would like 80 words … 🙂 Can you point me to the file/files where I can hack this?

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • go to index.php and look for <?php the_excerpt();?> If it exists, change it to <?php the_content();?> Now you can go to your posts and count out 80 words and click the More button where you would like your post length to be. You will get a tag inserted in your text that looks like <–more–> indicating that this is where your front page post length will stop.

    Sounds complicated, but it’s not, and it’s what most people do. Also, if you want to customize the “continue reading” text, your <?php the_content();?> should have desired text in single quotes between the brackets like these examples:

    <?php the_content(‘Continue Reading’);?>
    <?php the_content(‘Read More of This Post’);?>

    Hope this helps

    Thread Starter Argentum

    (@argentum)

    Thanks! Will try it out!

    a better way is to add
    post_settings['post_content_length'] = 80;
    in core.php, after
    $post_settings = get_option("mystique");

    Thread Starter Argentum

    (@argentum)

    🙂 Thanks a lot!

    Thread Starter Argentum

    (@argentum)

    And how would I do to make that setting go into the featured post slideshow as well?

    Thread Starter Argentum

    (@argentum)

    Is the text in the featured post cached somewhere, or it it read in real-time?

    Thread Starter Argentum

    (@argentum)

    echo ‘<div class=”summary”>’.mystique_strip_string(420, strip_tags(strip_shortcodes($featured_post[‘post_content’]))).'</div>’;

    in featured-post.php

    Would that be it?

    yes, change the “420” value with another one.

    hello, what is core.php , i dont have such file ? i also need to decrease post length.

    It’s a WordPress core file and it should never be edited unless you really, really, know what you’re doing. Try adding the following to your theme’s function.php file:

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

    @esmi Thanks for that little snippet of code for decreasing excerpt size. Works a treat!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Post length on front page’ is closed to new replies.