How to use limit post content on archive page in WordPress?

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.

error code: 523