Advertisement
Guest User

Untitled

a guest
Jul 1st, 2021
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('after_setup_theme','remove_parent_widgets');
  2.  
  3. function remove_parent_widgets() {
  4. remove_filter('get_the_excerpt', 'appointment_post_slider_excerpt');
  5. }
  6.  
  7.  
  8. add_filter('get_the_excerpt', 'appointment_post_slider_excerpt1');
  9.  
  10. function appointment_post_slider_excerpt1($output) {
  11. $output = strip_tags(preg_replace(" (\[.*?\])", '', $output));
  12. $output = strip_shortcodes($output);
  13. $original_len = strlen($output);
  14. $output = substr($output, 0, 1000);
  15. $len = strlen($output);
  16. if ($original_len > 1000) {
  17. $output = $output;
  18. return '<div class="slide-text-bg2">' . '<span>' . $output . '</span>' . '</div>' .
  19. '<div class="slide-btn-area-sm"><a href="' . esc_url(get_permalink()) . '" class="slide-btn-sm">'
  20. . esc_html__("Read More", "appointment") . '</a></div>';
  21. } else {
  22. return '<div class="slide-text-bg2">' . '<span>' . $output . '</span>' . '</div>';
  23. }
  24. }
Advertisement
RAW Paste Data Copied
Advertisement