Relevanssi - A Better Search
[resolved] Set excerpt length (2 posts)

  1. teeli
    Posted 3 years ago #


    Is it possible to set Relevanssi's excerpt length through a function (or action, filter ...)?

    I have website using Relevanssi and it has a mobile version using a separate mobile theme. I'd like the excerpt to be shorter on the mobile site than it is on the main site, instead of the same global setting for both themes.


  2. Mikko Saari
    Plugin Author

    Posted 3 years ago #

    Yes, you can use the pre_option_relevanssi_excerpt_length and pre_option_relevanssi_excerpt_type filters. There's no builtin filter hook in Relevanssi, but you can use the pre_option filters with any option in WordPress, it's a very powerful feature.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.