Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Staff Post Excerpt Length

Home / Forums / Virtue Theme / Staff Post Excerpt Length

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
April 1, 2020 at 11:09 pm

Hi Ben

Hope this finds you well;

I can’t seem to target the staff posts excerpt length… I simply want to turn off the theme excerpt (set in Options) and use my own as follows; what am I doing wrong ?

// remove theme excerpt
add_action('init', 'custom_child');
function pddcustom_child() {
remove_filter( 'get_the_excerpt', 'virtue_custom_excerpt_more' );
add_filter('virtue_portfolio_partial_excerpt', '__return_false');
}

// add custom excerpt
function 111custom_excerpt_length($length) {
global $post;

if ($post->post_type == 'staff') return 10;

else return 40;
}
add_filter('excerpt_length', '111custom_excerpt_length', 99);

Thanks!

  • This topic was modified 6 years ago by Solace.
  • The forum ‘Virtue Theme’ is closed to new topics and replies.