Tagged: x
-
AuthorPosts
-
May 3, 2016 at 10:29 am #910920
addictivebehaviourcoParticipantHi
I have manual excerpts on all my posts, one reason being that a lot of them link other sites. I would like to enforce a default excerpt length but for some reason the option for this in the blog customizer doesn’t work for me.
Any ideas how I can set a default excerpt length for all posts.
Thanks
NeilMay 3, 2016 at 10:29 am #910922
addictivebehaviourcoParticipantThis reply has been marked as private.May 3, 2016 at 1:58 pm #911286
Prasant RaiModeratorHello There,
Thanks for writing in!
You can add 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;Thanks.
May 4, 2016 at 3:35 pm #913169
addictivebehaviourcoParticipantHi
Thanks for this but it hasn’t worked. Sorry I am a bit of a newcomer to php editing but where do i add that code in the child theme functions file? At the bottom?
If you can take a look it would be much appreciated.
Many thanks
NeilMay 4, 2016 at 9:18 pm #913601
FriechModeratorHi Neil,
You can add that code on the bottom of the child theme’s functions.php file. If that does not work, please provide us FTP credentials in private reply, so we can take a closer look.
Thanks.
May 5, 2016 at 5:43 am #914094
addictivebehaviourcoParticipantThis reply has been marked as private.May 5, 2016 at 5:44 am #914096
addictivebehaviourcoParticipantThis reply has been marked as private.May 5, 2016 at 11:33 am #914521
JadeModeratorHi Neil,
Thanks for the details but the FTP access isn’t set to the correct directory.
Kindly set it correctly so that we could access your site files.
Thank you.
May 11, 2016 at 1:55 pm #986355
addictivebehaviourcoParticipantThis reply has been marked as private.May 11, 2016 at 8:03 pm #986903
Rue NelModeratorHello Neil,
Thanks for the updates!
When you use manual excerpt, it will not apply any word limiter. It will display all the manual excerpt. Word limiter will only be used is it is needed to generate an automatic excerpt from the content.
The manual WordPress excerpt is often confused with the automatic excerpt or with the teaser (the part of a post that appears on the front page when you use the More tag). While both are related to the manual excerpt, they are different from it.
The relationship between the three is this: When a post has no manual excerpt and the post template uses the the_excerpt() template tag, WordPress generates an excerpt automatically by selecting the first 55 words of the post. When the post template uses the the_content() template tag, WordPress will look for the More tag and create a teaser from the content that precedes the More tag.
Learn more about excerpts from here: https://codex.wordpress.org/Excerpt
May 12, 2016 at 3:12 am #987353
addictivebehaviourcoParticipantOk thanks
I understand that I am using manual excerpts and that the blog settings don’t affect this.
Is there any way to add a default excerpt length when using manual excerpts please? This is what I am trying to find out.
Thanks
NeilMay 12, 2016 at 3:33 am #987383
Rue NelModeratorHello Neil,
As I mentioned before, the default excerpt length will only be applied if you do not use a manual excerpt. The best way to limit it is to edit your manual excerpt. If you want the excerpt limit, you can remove your manual excerpt and add some contents. By then, the automatic excerpt along with its excerpt length will work.
Hope this explains briefly.
May 12, 2016 at 8:56 am #987790
addictivebehaviourcoParticipantOk yes I get the point!
“I understand that I am using manual excerpts and that the blog settings don’t affect this.”
But I was trying to find a better way than counting words each time I want to add a manual excerpt. Which is gona be every time as I don’t want to keep using the same content throughout my site.
Obviously there isn’t a better solution for this aside from counting the words and limiting each manual post excerpt individually. No worries.
Thanks anyway
May 12, 2016 at 12:36 pm #988166
RupokMemberYou are welcome and thanks for understanding.
Have a nice day!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-910920 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
