-
AuthorPosts
-
October 7, 2015 at 12:08 pm #615316
I have tried many times but this feature doesn’t work.
URL: http://www.fabiofrau.it
wordpress version: 4.3.1
theme version: X 4.1.1
shortcode plugin version: I have Cornerstone and so I have canceled it. (but I had the same problem with the short code plugin activated)October 7, 2015 at 12:38 pm #615371Hello Fabio,
Thanks for writing in!
In my local setup blog excerpt length is working as expected by changing the excerpt length values under Customizer > Blog > Excerpt Length. Having said that you can change the excerpt length by adding following code in your child theme function.php file:
if ( ! function_exists( 'x_excerpt_length' ) ) : function x_excerpt_length( $length ) { return x_get_option( 'x_blog_excerpt_length', '60' ); } add_filter( 'excerpt_length', 'x_excerpt_length' ); endif;
Note: As per your requirement change value 60 that will modify excerpt length.
If that does not help would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
October 7, 2015 at 1:40 pm #615465This reply has been marked as private.October 7, 2015 at 4:31 pm #615680I have an update. I have adjusted my blog by myself, and I have the x child properly installed, but I have the same old problem : I can’t set up the excerpt lenght. Now you have all my info. Can you solve this problem, please?
(I’m not a programmer and I don’t want to make another disaster).
Thank you very much,
Fabio 🙂
October 7, 2015 at 5:56 pm #615765October 8, 2015 at 4:00 am #616323This reply has been marked as private.October 8, 2015 at 5:10 am #616380Hi Fabio!
Thanks for writing back.
I’ve logged into like you said and have added the code we supplied in the child theme directory. Which is /blog/wp-content/themes/x-child/functions.php, if you open that file you should see the code. 🙂
Unfortunately I still couldn’t access your WordPress website dashboard, how do you access it? Both wp-admin and wp-login.php return a 404.
We’re here to help! 🙂
Thanks.
October 8, 2015 at 5:20 am #616393This reply has been marked as private.October 8, 2015 at 8:12 am #616559Hi there Fabio!
Thanks! I’ve checked your posts in the admin and they don’t have a excerpt set.
Under “Screen options” on each post, make sure “Riassunto” is checked, which is the excerpt and add your custom excerpt you want to display and it should work perfectly. 🙂
Thank you!
October 8, 2015 at 10:06 am #616727Hi Staff,
now excerpt (under screen option) is checked and I have added manually a 12-15 lines excerpt for every article.
My problem is that “excerpt length” (in Cornerstone> blog> content) doesn’t work.
At the moment I have an excerpt length of 55, but when I change this value, for example 5, nothing happens. The length of my excerpts doesn’t change at all.October 8, 2015 at 1:15 pm #616995Hi there,
I’ve done some testing on my local setup and excerpt length works fine. For this to work you need to remove the manual excerpt from your post, somehow it’s not working on your site. Please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
Since you’re using manual excerpt, you can add the following code in your child theme’s functions.php file to limit the length of your manual excerpt.
function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well global $post; $raw_excerpt = $text; if ( '' == $text ) { $text = get_the_content(''); $text = strip_shortcodes( $text ); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); } $text = strip_tags($text); $excerpt_length = apply_filters('excerpt_length', 55); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); //since wp3.3 return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); //since wp3.3 } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'wp_trim_all_excerpt');
Cheers!
-
AuthorPosts