Home Forums Free Themes Corpo Eye Length of text in Futures Slider in CorpoEye Theme

This topic contains 3 replies, has 2 voices, and was last updated by  wensolutions 1 year, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #55612

    DMakedonskiy
    Participant

    How to reduce or limit the number of characters (or lines) in the text that appears on the slide on the Futures Slider in Neaper? Now displays about 4 lines of text.

    #55617

    wensolutions
    Keymaster

    Hello @dmakedonskiy,

    The theme itself does not have the feature to control the words to display in the slider .

    However you can achieve what you want through the use of child theme .

    You can create the child theme using the plugin given below .

    https://wordpress.org/plugins/wp-child-theme-generator/

    After activating the plugin in your child theme functions.php file paste below given Code.

    add_filter('corpo_eye_filter_slider_caption_length', 'corpo_eye_child_slider_excerpt_length' );
    
    function corpo_eye_child_slider_excerpt_length(){
    
    	return 10;
    }

    You can set the no according to your requirement .

    Hope this helps .

    Best Regards!!

    #63497

    DMakedonskiy
    Participant

    Hello!

    I’ve made a child theme.
    Unfortunately, when I added your code to my function.php file in child theme, WordPress reported a syntax error: syntax error, unexpected ‘function’ (T_FUNCTION)
    Error line (16): function corpo_eye_child_slider_excerpt_length(){
    ——————————————————————

    My Function.php:

    <?php
    // Exit if accessed directly
    if ( !defined( ‘ABSPATH’ ) ) exit;

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED – Do not modify or remove comment markers above or below:

    if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
    function chld_thm_cfg_parent_css() {
    wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’, array( ‘font-awesome’,’jquery-sidr’ ) );
    }
    endif;
    add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’, 10 );
    add_filter('corpo_eye_filter_slider_caption_length', 'corpo_eye_child_slider_excerpt_length' );

    function corpo_eye_child_slider_excerpt_length(){

    return 10;
    }

    // END ENQUEUE PARENT ACTION

    #63527

    wensolutions
    Keymaster

    Hello @dmakedonskiy,

    When we checked for the issue locally by pasting the code we have provided, we are unable to find any kind of such issues.

    The issue may have caused on your side may be because you have missed semicolon while pasting the code into your child theme.

    So please replace all of your code in the child theme with the exact code given below.

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED – Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
    function chld_thm_cfg_parent_css() {
    wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'font-awesome','jquery-sidr' ) );
    }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
    add_filter('corpo_eye_filter_slider_caption_length', 'corpo_eye_child_slider_excerpt_length' );
    
    function corpo_eye_child_slider_excerpt_length(){
    
    return 10;
    }
    
    // END ENQUEUE PARENT ACTION

    Hope this helps.

    Best Regards!!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.