From 6a938273705c7f08456ee867c95799a64e624f2b Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 17 Aug 2018 10:33:01 -0400 Subject: [PATCH] adding filter for testimonial rotator for the read more link --- content-search.php | 3 --- content-single.php | 2 ++ functions.php | 12 ++++++++++-- single.php | 7 +++++-- style.css | 14 +++++++++++++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/content-search.php b/content-search.php index 1ba7228..793f798 100644 --- a/content-search.php +++ b/content-search.php @@ -13,9 +13,6 @@ ', esc_url( get_permalink() ) ), '' ); ?> -
- -
diff --git a/content-single.php b/content-single.php index 2ca25c9..e72b95e 100644 --- a/content-single.php +++ b/content-single.php @@ -6,6 +6,8 @@ $post_date = of_get_option('post_date'); $post_footer = of_get_option('post_footer'); $post_date_class = ((!empty($post_date) && $post_date == ' ') || has_post_thumbnail()) ? " no-date" : ""; +global $post; +$post_type = $post->post_type; ?>
>
diff --git a/functions.php b/functions.php index e3c4b03..490d07f 100644 --- a/functions.php +++ b/functions.php @@ -110,8 +110,8 @@ function accesspress_parallax_widgets_init() { ) ); register_sidebar( array( - 'name' => __( 'Footer One', 'accesspress-parallax' ), - 'id' => 'footer-1', + 'name' => __( 'Testimonials', 'accesspress-parallax' ), + 'id' => 'testimonials-sidebar', 'description' => '', 'before_widget' => '', @@ -348,3 +348,11 @@ function my_nav_wrap() { // return the result return $wrap; } +function hg_testimonial_rotator_the_excerpt( $html, $limit ) +{ + global $post; + $link = get_permalink( $post->ID ); + $more_text = " ...Read More "; + return wp_trim_words(get_the_excerpt(), $limit, $more_text); +} +add_filter('testimonial_rotator_the_excerpt', 'hg_testimonial_rotator_the_excerpt', 10, 2); diff --git a/single.php b/single.php index 8f8756b..c511794 100644 --- a/single.php +++ b/single.php @@ -4,7 +4,8 @@ * * @package accesspress_parallax */ - +global $post; +$post_type = $post->post_type; get_header(); ?>
@@ -36,7 +37,9 @@ get_header(); ?>
+ + + -