Sometimes View full post button go out of the Graphene Slider due to increased excerpt length. Default excerpt length in WordPress is 55 words. You can override this by using a plugin or custom excerpt length function. But it affects the excerpt everywhere. So, here is a function which affects only the Graphene Slider excerpt length.
Put this code anywhere between opening <?php and closing ?> php tags in the child theme functions.php file.
function graphene_custom_slider_excerpt_length(){ graphene_set_excerpt_length( 35 ); } add_action( 'graphene_before_slider', 'graphene_custom_slider_excerpt_length' ); |
It limits the slider excerpt length to 35 words. You can change it to make your slider happy! ![]()
Thanks Syahir!
Follow these topics Graphene, WordPress
Short Link:


14 comments
Skip to comment form ↓
Ashish
April 3, 2012 at 5:05 pm (UTC 5.5) Link to this comment
On which php page do we need to add this function?
Prasanna SP
April 10, 2012 at 10:46 am (UTC 5.5) Link to this comment
In your child theme functions.php file.
Chitaranjan
April 10, 2012 at 8:27 pm (UTC 5.5) Link to this comment
How can I disable the Excerpt?
Prasanna SP
April 11, 2012 at 3:04 pm (UTC 5.5) Link to this comment
Chitaranjan
April 11, 2012 at 4:54 pm (UTC 5.5) Link to this comment
Tried this but this disable title also, is it possible to show title?
Prasanna SP
April 11, 2012 at 7:15 pm (UTC 5.5) Link to this comment
Try this,
Chitaranjan
April 12, 2012 at 3:18 pm (UTC 5.5) Link to this comment
That’s works perfectly to show only title & hide excerpts, only thing is…there seems to be little overlay above the title background.
Alek
May 6, 2012 at 1:37 am (UTC 5.5) Link to this comment
Where to insert in which document..??
Prasanna SP
May 13, 2012 at 2:13 pm (UTC 5.5) Link to this comment
In your child theme’s functions.php file. If it is blank, add
<?phpat the beginning of the file and?>at the end.Andrea
May 21, 2012 at 6:35 pm (UTC 5.5) Link to this comment
Dear, i’m a dummy, newbie at my first site; i have try to apply
function graphene_custom_slider_excerpt_length(){; i put in In my child theme’s functions.php file, bur result was orrible: cose is visible in the higjer part of page.graphene_set_excerpt_length( 35 );
}
add_action( 'graphene_before_slider', 'graphene_custom_slider_excerpt_length' )
It’s possible to see it without admin permissionn please help
Thanks
Andrea
Prasanna SP
June 11, 2012 at 9:39 am (UTC 5.5) Link to this comment
If your child theme’s functions.php file is empty, please add php systan while adding this code. i.e put
<?phpat the beginning of functions file and close the function with?>Try this,
<?php
function graphene_custom_slider_excerpt_length(){
graphene_set_excerpt_length( 35 );
}
add_action( 'graphene_before_slider', 'graphene_custom_slider_excerpt_length' );
?>
Chris
November 9, 2012 at 2:39 am (UTC 5.5) Link to this comment
Hi, thanks for your help but your code makes my site totally crashed!
I must reinstall the site!
It writes this:
Warning: Cannot modify header information – headers already sent by (output started at /home/sportmon/public_html/wp-content/themes/graphene/functions.php:68) in /home/sportmon/public_html/wp-includes/pluggable.php on line 881
And it doesn’t work anymore!
I just want to keep only titles in the slider!
Thanks
Prasanna SP
November 9, 2012 at 8:32 pm (UTC 5.5) Link to this comment
Replied to this comment through email. The issue is resolved now.
raozkardes
February 22, 2013 at 1:27 pm (UTC 5.5) Link to this comment
Hi, How can I improve the length Graphene Slider title? Can you write a function to shorten the title?
Thank you.