Hi there. Is there a way that we can have the excerpt restricted to a specific number of lines including the Title? I noticed that the buttons are not aligned if the title is longer than the others. Hope you can help me with this. Thanks in advance.
Hi, Refer This http://wordpress.stackexchange.com/questions/70913/how-can-i-limit-the-character-length-in-excerpt Add these lines in function.php file PHP: function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Hi Krish, Appreciate your help but it didn't work. I added the line but all it did is upper at the upper portion of my header as a text. kindly check attached image. I also couldn't find the function.php file anymore on my WP Theme editor. Hope for a fast response to this issue. Thanks.
Hi Krish. I figured it out by googling. I had a hard time figuring how to change the excerpt link as you only provided the code when you could have told me to change 20 to the number of characters I want to have. I do hope that when you provide assistance please know that some of those who ask are may not be familiar with how to customise codes. I also would like to ask if there is a away to limit the lines or character of the title on these excerpts. What I want to happen is that all the READ MORE links are aligned together. Hope you can assist me with this. Thanks.
Hello, Please goto (Appearance -> Editor -> function.php) paste above code at the end of file and update file Thanks & Regards Pramod Patel
Hi Pramod, I was able to successfully insert the code already yesterday. What I need though is whether we can limit the lines or characters instead of words and do it not only on the content but the title of the post as well. Kindly check my last message. Looking forward to your assistance. Thanks in advance.
Hi renarts Unfortunately there is no way to limit the excerpt by line. But you can use some trick. 1. The first thing you need to do is to add this code to your functions.php file PHP: function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); 2. Now if you still find a post which has more lines, then edit your post and make you excerpt even shorter with "Insert Read More Tag Button".