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.
Related Posts:
- Read more tag shows up on EVERY post
- “Read more” link doesn’t show up when the post length is under the excerpt length
- Custom excerpt showing first paragraph (with HTML formatting)
- Different ‘read more’ links
- Read more on the post page itself
- Excerpt using Read More Tag
- How to wrap “Read More” link in a DIV tag?
- Problem with viewing single page correctly. (taken half way down the page on click through)
- Remove ‘read more’ link when post is shorter than excerpt
- Append Second Link to Read More
- “Continue reading” not on some posts, full excerpts not shown
- the_excerpt() is not trimming at
- Remove Default Read More Link in Manual Excerpt RSS Feed
- multiple excerpt length and styles
- how to use the_excerpt for two post queries?
- Remove the excerpt and “… Read More” from the featured content on the home page with child theme
- Is there a way to display the ‘Read more’ link if it’s within a range?
- Using wp_trim_excerpt to get the_excerpt() outside the loop
- How to end the excerpt with a sentence rather than a word?
- How can i limit the character length in excerpt? [duplicate]
- How to include line-breaks in the_excerpt?
- How to get the unfiltered excerpt, without […] or auto-excerpting
- Remove “Continue Reading” Link From the Teaser Excerpt Only
- Modify youtube video size on one page and show another size on different page
- Modify ‘Read more’ link adding a new class
- Limit the_excerpt in the first point (.) of the sentence
- Excerpts that don’t truncate words
- Spacing within the excerpt
- How to remove “Read on” content in the_excerpt?
- the_excerpt Read More Filter
- How to get the excerpts of all children pages
- Empty excerpt using wp_get_recent_posts
- The excerpt: Display text OR image OR video
- Read More for Excerpt not working
- adjust the_excerpt based on template page
- First letter cutting off in excerpt
- How to display links in excerpt? [duplicate]
- Getting the_excerpt to link to child pages [closed]
- How to get the excerpt of a page before more tag?
- Getting first 20 words without excerpt
- Change excerpt length of first post
- Display oEmbed in the_excerpt
- Remove Text within Header tags in the Excerpt
- Line in excerpt and max 5 lines
- Include post title in readmore link?
- How to put “Read more” link in Custom Excerpt inside p tag?
- Exclude read more in the_excerpt [closed]
- How to apply excerpt length only on front end?
- get_the_excerpt() issues – returns the excerpt twice or not at all?
- Excerpt content
- new_excerpt_more link not working properly
- read more, even if excerpt not trimmed
- Give “Read More” precedence over excerpt() word count
- Show excerpts of posts on P2 Home page
- How to change the length of excerpt() method?
- Removing h3s in excerpt output?
- get_the_excerpt without images
- Automatic excerpts
- How to properly show the Excerpt only if it exists?
- The excerpt doesn’t add Read more
- Text with special class as excerpt (or exclude special class)
- Display post excerpt instead of content, if available
- Show Excerpts In Twenty Eleven Theme
- How do you edit the html of teaser excerpts
- Add custom read more to the_excerpt and
- Remove [ and ] from excerpt
- Is it possible to use words as starting and ending points of excerpt parameters?
- Split the_content into two parts
- How to replace get_the_excerpt with first N words of post article while stripping html
- How to edit a typo in excerpt?
- My post excerpt does not work
- Adding […] string for a custom excerpt function
- Replace text in excerpt
- How to achieve two different excerpt types on one WordPress site?
- Modify excerpt link
- Reblog WordPress to another WordPress?
- How to enable excerpts just on the “Posts page”
- Cannot figure out how to add a read more link to a manual excerpt. Please help
- Excerpt being limited too early
- Help needed using wp_trim_words
- Read More in the actual excerpt
- Excerpt of certain page to display on home page
- get_the_excerpt adding unwanted links to output html
- How to add a new line to an excerpt?
- Excerpt “Read More” link
- Force authors to use Manual Excerpt in WordPress and multiple Manual Excerpts
- Excerpt displays the current page excerpt not one being pulled
- Trimming breaks up markup
- WordPress excerpt with formatting and allowing selected tags
- Can’t change excerpt length and more tag
- Add rel=lightbox to custom string
- get_posts displaying wrong permalink for “continue reading” link
- WordPress Post Format If Statement?
- Excerpt Problems
- Function to shorten string without cutting off last word
- How to show excerpt field
- Get a raw value of excerpt
- Need to show post summary in sidebar
- Limited excerpt with readmore
- Read more opens attachment