WordPress.org

Ready to get started?Download WordPress

Forums

Formation
[resolved] Slider Text Length (7 posts)

  1. GavinR121
    Member
    Posted 1 year ago #

    Hi there

    Firstly many thanks for your theme, it looks great and so far very easy to use.

    I just have a small question regarding the text that goes in boxes over the Homepage Slider. I have created a post with the correct Featured category setting and used the featured image too and all works fine. It's just that the text I have put in the main text area (which appears in the black faded box over the image) seems to be cut off after just 12 or 13 words. Is there a way to increase to the word count that displays here like in your demo of the theme?

    My site is work in progress at: http://www.redwing-hosting.com/ianallan/

    Thank you in advance for any advice you can give here.

    Gavin

  2. Template Express
    Member
    Theme Author

    Posted 1 year ago #

    Hello, in the functions.php file look for slider excerpt length and increase to suit your needs

  3. GavinR121
    Member
    Posted 1 year ago #

    Hi Ossie

    Many thanks for your quick reply.

    Sorry but I can only find the following code relating to in functions.php and don't see this. Should I be looking somewhere else?

    /**
    * Implement excerpt for homepage slider
    */
    function get_slider_excerpt(){
    $excerpt = get_the_content();
    $excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
    $excerpt = strip_shortcodes($excerpt);
    $excerpt = strip_tags($excerpt);
    $excerpt = substr($excerpt, 0, 150);
    $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
    $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
    return $excerpt;
    }

  4. Template Express
    Member
    Theme Author

    Posted 1 year ago #

    no that's the correct bit - change the 150 to increase the excerpt length

  5. GavinR121
    Member
    Posted 1 year ago #

    Hi again

    That's what I thought I tried that but it didn't do anything. Just me being thick I think as it's working absolutely fine now though!

    Many thanks again your your help much appreciated.

  6. Template Express
    Member
    Theme Author

    Posted 1 year ago #

    OK good to hear you got it working. Good luck with your website.

  7. susana_fernandez
    Member
    Posted 7 months ago #

    Hi,

    I have the same problem and i can't fix it yet . I changed functions.php like this :

    function get_slider_excerpt(){
    $excerpt = get_the_content();
    $excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
    $excerpt = strip_shortcodes($excerpt);
    $excerpt = strip_tags($excerpt);
    $excerpt = substr($excerpt, 0, 450);
    $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
    $excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
    return $excerpt;
    }

    and still cuts the text at the 15teen character .. what else can I do to try and fix it , i want the same length as your demo,

    my site in progress:

    http://www.dinamitacostarica.com/natalia/

    i love your theme , thank you ,

    susana

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic