character limit on titles

This topic contains 2 replies, has 2 voices, and was last updated by sank sank 7 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11808
    sank
    sank
    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 Marcinko
    Ernest 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:

    $this->post[$key] = apply_filters('rpp_item_after_postprocessing', $post);

    to this:

    $this->posts[$key] = apply_filters('rpp_item_after_postprocessing', $this->posts[$key]);

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #11815
    sank
    sank
    Participant

    works great!!! 🙂
    thanks!

    • This reply was modified 7 years, 2 months ago by sank sank.
Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.