Home › Forums › Free Themes › Corpo Eye › Length of text in Futures Slider in CorpoEye Theme
- This topic has 3 replies, 2 voices, and was last updated 6 years, 1 month ago by wensolutions.
-
AuthorPosts
-
October 13, 2017 at 2:11 am #55612DMakedonskiyParticipant
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.
October 13, 2017 at 2:48 am #55617wensolutionsKeymasterHello @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!!
January 17, 2018 at 3:54 pm #63497DMakedonskiyParticipantHello!
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
January 17, 2018 at 11:33 pm #63527wensolutionsKeymasterHello @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!!
-
AuthorPosts
- You must be logged in to reply to this topic.