-
Author
-
June 26, 2014 at 01:04 #20932shmallParticipant
Hi,
We are using KLEO and would like to know how to limit the post excerpt in Grid view, as when the post are in japanese or chinese it will display a long excerpt.
Thanks,
June 26, 2014 at 13:11 #20978CatalinModeratorHello,
You need to add in functions.php file from the child theme folder this code:
COPY CODE\[[^\]]*\]
where
COPY CODE( $limit = 10 )
“10” in the number of words to display.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 27, 2014 at 01:37 #21062shmallParticipantHi Catalin,
Thanks for the reply.
After I pasted the code to child theme’s functions.php
I got the error under the post
Warning: preg_replace() [function.preg-replace]: Unknown modifier ‘\’ on line 24
Hope you would know how to fix it.
best regards,
June 27, 2014 at 11:16 #21080CatalinModeratorHello,
Please send me FTP access to your child theme and credentials for your WordPress admin panel. Reply as private for security reasons.
Thank you,
CatalinHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 10, 2014 at 21:08 #38475exenewyorkerParticipantTried the code above and it completely removed the excerpt in the archive-porfolio view. Also tried the following in the kleo-child functions.php to change the excerpt to word limit instead of characters and nothing changed:
COPY CODEif ( ! function_exists( 'kleo_excerpt' ) ) { function kleo_excerpt( $limit = 15 ) { if ( $chars ) { $excerpt = explode( ' ', get_the_excerpt(), $limit ); if ( count( $excerpt ) >= $limit ) { array_pop( $excerpt ); $excerpt = implode( " ", $excerpt ) . '...'; } else { $excerpt = implode( " ", $excerpt ) . ''; } $excerpt = preg_replace( '<code>\[[^\]]*\]</code>', '', $excerpt ); return '<p>' . $excerpt . '</p>'; } else { $excerpt = get_the_excerpt(); return '<p>'. substr( $excerpt, 0, $limit ) . ( strlen( $excerpt ) > $limit ? '...' : '' ) . '</p>'; } } }
December 15, 2014 at 16:57 #39161AbeKeymaster@exenewyorker a better option is to edit wp-content/themes/kleo/page-parts/portfolio-masonry.php template and change the function parameters without adding the above code.
You will see something like this at the end of the file
<?php echo kleo_excerpt( 60, false ); ?>
where 60 is the char limit
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 14, 2016 at 10:27 #98470dinnapParticipantHi.
We have the same problem, but none of the above solutions work.
See our site for the case, or the attached picture.
Regards,
ThomasAttachments:
You must be logged in to view attached files.January 14, 2016 at 14:40 #98510AbeKeymasterHi, you are not using the KLEO Posts shortcode to which this topic is reffering to and you are using Posts Grid shortcode that does not have that option. You can edit the posts and set a custom excerpt in the Excerpt field
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.Attachments:
You must be logged in to view attached files. -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.