SHARE
TWEET

Cara Membatasi Judul Wordpress

pustakakoran Jan 28th, 2019 (edited) 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.     if (strlen($post->post_title) > 20)
  4.        echo substr($post->post_title, 0, 20) . ' ...';
  5.     else
  6.        echo $post->post_title;
  7.  
  8. ?>
  9.  
  10. ============================ atau:
  11.  
  12. echo mb_strimwidth($post->title, 0, 20, ' ...');
  13.  
  14. ===========================
  15. kalau ga support php bisa pakai html + css juga bisa, tinggal set widthnya dan tambahin text-overflow: ellipsis;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top