Excerpt being limited too early
Excerpt being limited too early
Excerpt being limited too early
Keep excerpt from stripping URLs and enable autoembed for youtube ONLY?
get_the_permalink() does not modify or do anything to the_excerpt(). That’s now how viewing post content works. All it does is output the permalink the single post. When you visit that link it will load a single post using the template it finds according to the template hierarchy. You need to make sure that the template … Read more
You’re looking at the code wrong. If there is an excerpt it’s not going to affect that line you changed. Are you actually entering text into the excerpt field in the post edit? try changing it to this to see if it’s even working: if (!is_search()) { echo get_the_content(); } else { echo get_the_content(); }
You can explode the content of excerpt by dot. For example: $text = “Morbi consequat tempor augue. Nec fringilla eros auctor scelerisque. Etiam in ullamcorper tellus. Sed ac dui rutrum.”; $pieces = explode(“.”, $text); echo $pieces[1]; // get second sentence = Nec fringilla eros auctor scelerisque Maybe this can help you.
There is no default inclusion of “read more” links in WordPress feed descriptions. This is probably being done by your theme or a plugin. You can customize your feed output as explained here:https://codex.wordpress.org/Customizing_Feeds
use wp_trim_words() like so: <?php $moreLink = ‘<a href=”‘ . get_the_permalink() . ‘”>Read More</a>’; echo ‘<div class=”advert-div”>’; ?> <h2 class=”ad-title”><?php the_title(); ?></h2> <?php echo wp_trim_words(do_shortcode(“[the_ad id=”.$post->ID.”]”), 55, $moreLink); echo ‘</div>’; Just substitute however you need to get the permalink for your add in to the $moreLink if needed.
General notes: it’s not good practice to modify the Parent theme. If the theme gets updated, then your changes will be lost. the Child theme is loaded first. Any missing ‘parts’ (like a template) are then loaded from the parent theme. So a page.php in your child theme will be used instead of the parent’s … Read more
you need to use get_the_excerpt https://codex.wordpress.org/Function_Reference/get_the_excerpt Where the argument can be the page id or the post object you want to get the excerpt from.
get_the_excerpt only returns one excerpt