-
-
Hello,
I have two observation and if you could help that would be great.
1) How to make that button “Read more” would not appear if the text in the excerpt is not longer than in the post. Because otherwise usually people click “Read more” and get the same text they saw in short description of the post.
2) Is it possible to make links active in the excerpt?
Thank you.
-
Hello,
Can you please be more specific? In what element are you using the read more? Please send us a link where are you using it, or a screenshot.
Best regards!
-
Hello,
“Read more” buttons are standard feature in blog page. My sites blog: https://www.aku.lt/blog/
To the same: How to justify text in the blog post excerpt.
thank you in advance
-
Hello,
1-For your request you will have to edit theme files. Please go to file: \includes\view\blog\loop-index.php and add these lines:
$words_excerpt = explode(' ', get_the_excerpt() ); $words_content = explode(' ', get_the_content() );
right after this line(21):
$content = str_replace(']]>', ']]>', apply_filters('the_content', $content ));
Now in the same file, find these lines:<?php if(!is_single()): ?> <a href="<?php echo get_permalink() ?>" class="btn-bt <?php echo esc_attr($cl_redata['overall_button_style'][0]) ?>"><span><?php _e('Read More', 'codeless') ?></span><i class="moon-arrow-right-5"></i></a> <?php endif; ?>
And replace with these:
<?php if(!is_single() && (count($words_excerpt) < count($words_content))): ?> <a href="<?php echo get_permalink() ?>" class="btn-bt <?php echo esc_attr($cl_redata['overall_button_style'][0]) ?>"><span><?php _e('Read More', 'codeless') ?></span><i class="moon-arrow-right-5"></i></a> <?php endif; ?>
Save file and refresh page. It will hide the “Read more..” from posts which have the excerpt text equal or larger than the content.
2- To justify text, please add this code into your custom css box:.blog-article.alternate-style .content .text { text-align: justify; }
Best regards!
-
You must be logged in to reply to this topic.