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

Reply To: shortcode variables – exclude term

#11879
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

There is no such shortcode argument, so unfortunately that won’t work. A possible solution could be to make function on the ‘rpp_keywords’ filter, which is executed when the keywords are extracted.

Please note that this is not part of the plugin code and qualifies as a customization request, so I cannot guarantee it will work properly in every case.

I’ve tested the following code, use it in the functions.php file in your theme directory:

The $exceptions array contains the [post_ID => exception keywords array] pairs, you can add as many as you want with as many keywords as you need.
In the example this line:

[php] ‘1’ => array(‘word1’, ‘word2’),[/php]

excludes word1 and word2 when the post ID equals 1.

Also, make sure to save the instane options to clear the related posts cache, or to disable cache temporarily while testing (on the Advanced Options panel).