Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #832498

    Hi best supportes ;-)

    How can I reduce the length of the excerpt on the featured image slider?

    I tried it in the child > functions.php with

    add_filter( 'avf_feature_image_slider_excerpt_length', 'avf_feature_image_slider_excerpt_new_length', 999 );
    function avf_feature_image_slider_excerpt_new_length($length) {
    	return 10;
    }

    but it doesn’t work.

    Thanks for your input!

    Best regards
    Stephan

    #833306

    Hey Stephan,

    To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Best regards,
    John Torvik

    #834388

    Hi Torvik,

    I need to different excerpt lenghts: One for the big image in the magazine element, and a shorter one (roundabout 30%) for the featured slider, but I didn’t get it with “add_filter( ‘avf_feature_image_slider_excerpt_length’…”

    Here’s a screenshot:
    http://imgur.com/zqzH5kt

    Thousand thanks in advance
    Stephan

    • This reply was modified 6 years, 9 months ago by Yeti.
    #836228

    Hi,

    Did you specify the excerpt manually? This filter will only work if the post has no excerpt.

    Best regards,
    Ismael

    #836347

    Hi Ismael,

    yes I edit this text manually in the extra textarea “excerpt” below the mce.
    I there an alternative to “cut” this field similar to “avf_feature_image_slider_excerpt_length”?

    Thanks a lot + best regards
    Stephan

    #836848

    Hi,

    There is no filter for that, unfortunately. However, you can adjust the number of characters by using a script in the functions.php file.

    function ava_custom_script_mod(){
    ?>
    <script>
    (function($){
    	function a() {
    		$('.avia-featureimage-slideshow .avia-caption-content').text(function(index, curr) {
    					return curr.substr(0, 10) + ' ...';
    		 });
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_custom_script_mod');

    We set the number of characters to 10. Adjust as needed. Please note that this will limit the number of characters, not words.

    Best regards,
    Ismael

    #837955

    Hey Gods of Support,

    that’s really great. Thanks a lot!

    Best wishes,
    Stephan

    #837964

    Hi! We’re glad that Ismael was able to help you! We’ll close this topic now. For any other questions or issues, feel free to post them here on the forum and we will do our best to assist you.

    Thank you for using Enfold.
    Cheers!
    Sarah

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Reducing the length of the excerpt on featured image slider?’ is closed to new replies.