Maximum "Lines of Text (?)"

Viewing 8 posts - 1 through 8 (of 8 total)
  • #13068
    mkongx12
    Participant

    Dear One Design,

    First of all, thank you for this beautiful and simple theme! Love it!

    Just a silly question: how do I limit the lines as shown on each thumbnail in the gallery slider? I don’t know if I am naming this Topic Title correctly or not, but it would be great if you can teach me how to limit the “Lines of Text” of each post.

    Please have a look at this screenshot to see what I am talking about: http://www.mediafire.com/view/?uv9xycasxkda9xv

    Many thanks!

    Danny

    (I am using WP 3.5.1)

    #13105
    Daniel Tara
    Keymaster

    Add this code to functions.php:

    function minimatica_excerpt_length( $length ) {
    	return 50;
    }
    
    add_filter( 'excerpt_length', 'minimatica_excerpt_length' );

    Replace 50 with the number of words you would like to limit the excerpt.

    #13243
    mkongx12
    Participant

    Thank you, Daniel!

    Just wondering, where exactly should I paste those lines in that functions.php?

    I have pasted it right between

    “function minimatica_widgets_init() {”

    and

    “add_action( ‘after_setup_theme’, ‘minimatica_theme_setup’ );”

    as shown below, but nothing has changed.

    Thanks again,

    Danny

    ============= For your reference =============

    add_action( ‘after_setup_theme’, ‘minimatica_theme_setup’ );

    if ( ! function_exists( ‘minimatica_widgets_init’ ) ) :
    /**
    * Registers theme widget areas
    *
    * @uses register_sidebar()
    *
    * @since Minimatica 1.0
    */
    function minimatica_excerpt_length( $length ) {
    return 50;
    }

    add_filter( ‘excerpt_length’, ‘minimatica_excerpt_length’ );

    function minimatica_widgets_init() {
    register_sidebar(
    array(
    ‘name’ => ‘Sidebar’,
    ‘before_widget’ => ”,
    ‘after_widget’ => ‘‘,
    ‘before_title’ => ”,
    ‘after_title’ => ”
    )

    #13252
    Daniel Tara
    Keymaster

    Try adding it exactly at the end of the file. Remember to change the number to the number of words you would like to limit the excerpt to.

    #13296
    mkongx12
    Participant

    Hi there….

    Still the same. Nothing has changed. Have I done something wrong?

    Here is where I pasted it, all the way to the end:

    <?php
    break;
    endswitch;
    }
    endif;

    function minimatica_excerpt_length( $length ) {
    return 50;
    }

    add_filter( ‘excerpt_length’, ‘minimatica_excerpt_length’ );

    #13355
    Daniel Tara
    Keymaster

    You have misunderstood something important. The example above is just an example. 50 is actually very close to the default number of words WordPress prints which is 55. Try using a smaller number like 15 and you should see a difference.

    #13374
    mkongx12
    Participant

    Thanks Daniel!

    Now it works! But the new problem is: each thumbnail shows different number of excerpts.

    Have I done something wrong?

    Thanks!

    #13492
    mkongx12
    Participant

    Any solutions?

    Thanks again!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.