-
mkongx12Participant
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)
Daniel TaraKeymasterAdd 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.
mkongx12ParticipantThank 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’ => ”
)Daniel TaraKeymasterTry 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.
mkongx12ParticipantHi 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’ );
Daniel TaraKeymasterYou 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.
mkongx12ParticipantThanks Daniel!
Now it works! But the new problem is: each thumbnail shows different number of excerpts.
Have I done something wrong?
Thanks!
You must be logged in to reply to this topic.