This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

character limit on titles

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11808
    sanksank
    Participant

    hi can we have a character limit on titles so they are not so long, and have a “…” after something like 40 characters?

    #11810
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Yes, it is possible with a small modification and a custom code. Follow the steps below, I will try to guide you. If you need help with editing the files, you can fill the ticket details with FTP access, and I will do it for you.

    1. Open up the wp-content\plugins\related-posts-pro\includes\related_content.class.php file on your server and change line 1514 from this:

    [php]$this->post[$key] = apply_filters(‘rpp_item_after_postprocessing’, $post);[/php]

    to this:

    [php]$this->posts[$key] = apply_filters(‘rpp_item_after_postprocessing’, $this->posts[$key]);[/php]

    2. Then add this code snippet to the functions.php file in your active theme directory (copy from line 4):

    3. Open the plugin settings and save them without changing anything, so the cache will be cleared.

    The titles should appear trimmed now.

    #11815
    sanksank
    Participant

    works great!!! 🙂
    thanks!

    • This reply was modified 9 years, 4 months ago by sanksank.
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.