• I have a theme that I’m using called antinews. It has an options area in the admin panel to adjust some settings. One of the settings areas is excerpt length for a “featured category”. It works up to a number of approx. 300 words. Basically if I input 50 it sets the excerpt at about 50 words. If I set it at 300, then it increases to 300. But, if I set it over 300 to, say, 500, it stays at 300. Is there a max excerpt length in wp? I looked at some of the threads and mods to increase the excerpt lenght but it is global and I only want to increase it for this specific “featured category” div.

    Also I went into the specific featured5.php file in the includes folder for the theme and modified this code to increase $featuredcat2excerptlength to 650 as shown:

    [please mark your code using the ‘code’ button]

    <?php if(!isset($featuredcat5excerptlength) || empty($featuredcat5excerptlength) || !is_numeric($featuredcat5excerptlength)){ $featuredcat2excerptlength=650; } ?>
    	<?php if(strlen($rcsspthec) > $featuredcat5excerptlength){$rcsspthec=LimitText(trim($rcsspthec),10,$featuredcat5excerptlength,""); }?>

    Thanks for looking…..

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Netsultants

    (@netsultants)

    I really need to have a char length in this div set at around 500.

    is it purpose to have the one $featuredcat2excerptlength (number 2) within all the $featuredcat5excerptlength (number 5s) ?

    link to your site?

    Thread Starter Netsultants

    (@netsultants)

    I did a work around but I’d like to know why: get_the_excerpt() is generating a string that won’t go over 300 char.

    As you can see I removed the if stmnt and just using: get_the_content.

    It’s now allowing me to set the char length over 300. In fact I have it at 600.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    i don’t think there is a build-in limit to the excerpt;
    certainly not in terms of character limit.

    could it be that the LimitText() function that is limiting the output?

    Thread Starter Netsultants

    (@netsultants)

    I don’t know anything about the function or syntax for LimitText().
    I tried to look it up but found nothing. Though I kept the function in and it’s working so I don’t think that’s it.

    $rcsspthec=LimitText(trim($rcsspthec),10,$featuredcat5excerptlength,"")

    LimitText(x,y,$z,)
    what is
    x
    y
    z
    But I still think there is something with get_the_excerpt

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Increase excerpt size for one div class in a theme’ is closed to new replies.