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

Reply To: the option does not work

#20663
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

The ‘Description context’ option is not for removing the first X characters from the results content. That is only possible via a custom code.

Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case! Change the $remove variable to the number of characters you want to remove.

add_filter('asp_results', 'asp_remove_first_n_characters');
function asp_remove_first_n_characters($results) {
    $remove = 200;
    foreach ($results as $k => &$r) {
        if ( strlen($r->content) > $remove )
            $r->content = substr($r->content, $remove);
    }
    return $results;
}