Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change Displayed Description Length?

  • Avatar of Tori Deaux
    Tori Deaux
    Member

    @mindtweaks

    Hey there,

    The displayed description text is being truncated with an unlinked [...] as if it were a default post excerpt, at around 25-30 words.

    Changing the WP excerpt length through the dashboard or via a custom WP function doesn’t seem to affect it. I switched to the default BP theme, and yepp, it’s still excerpted!

    Any suggestions on lengthening the description that’s displayed?
    Much appreciated!
    Tori

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Tori Deaux
    Tori Deaux
    Member

    @mindtweaks

    Found it!

    By default, bp_create_excerpt (found in /bp-core/bp-core-template.php) sets a default length of 225. The Achievements plugin calls it in achievements-templatetags.php, causing descriptions longer than 225 characters to be truncated.

    As a temp fix, I copied bp_create_excerpt over to bp-custom.php, increased the $length, renamed it my_bp_create_excerpt, and then renamed it within the Achievements plugin as well. (I’m sure there’s a better way to change the $length, but this works for now)

    Glad you found a solution :)

    Avatar of Vernon Fowler
    Vernon Fowler
    Participant

    @vernonfowler

    Can we add something smaller to bp-custom.php as the function in /bp-core/bp-core-template.php contains the option to modify BuddyPress excerpts:
    ` // Allow plugins to modify these values globally
    $length = apply_filters( ‘bp_excerpt_length’, $length );
    `
    I realise this would (probably) affect excerpts throughout the site/community rather than just in select plugins, but if that is what I want to do, what code would I need in bp-custom.php ?

Viewing 3 replies - 1 through 3 (of 3 total)

The forum ‘Achievements’ is closed to new topics and replies.