0

Below are the code of wp post that show latest single post link in header. but post url text getting overlap, So please suggest how to modify below code to show first few word of post.

<?php$recentPosts = new WP_Query();
$recentPosts->query('showposts=1'); while ($recentPosts->have_posts()) :

$recentPosts->the_post();?>


<div><strong>What's Hot :</strong> <a href="<?php the_permalink() ?>">

<?php the_title(); ?></a></div>

<?php endwhile; ?>

You can get one example Here - codyplay.com

Thanks

Grapy
  • 85
  • 13
  • Check this. https://wordpress.stackexchange.com/questions/75691/limit-the-word-count-in-the-post-title You can use that function instead of "the_title()" in your code. – zipkundan Nov 12 '18 at 14:45
  • https://stackoverflow.com/a/11434149/2593099 – GDY Nov 12 '18 at 15:12

0 Answers0