Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hacking site wide activity…


  • benny148148
    Participant

    @benny148148

    Currently, new blog posts in my “site wide activity” more words than I’d like…I’d prefer for it to show maybe 10-15 words max for each new post.

    Where does BuddyPress create the “excerpt”…and how can I edit/shorten it?

    Thanks!

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

  • mspecht
    Participant

    @mspecht

    Hi,

    The excerpt is create in bp-blogs.php on line 284 (RC1) calling function bp_create_excerpt in bp-core.php line 807. bp_create_excerpt takes a limit parameter which defaults to 55 characters. It doesn’t look like you can easily adjust this without hacking the core, although I am no expert so you might be able to also hack an action together that will adjust the excerpt.


    benny148148
    Participant

    @benny148148

    Thanks mspecht…I tried editing the bp-core.php to see if it would shorten the blog post in the Site Wide Activity, but the site wide feed doesn’t seem to use bp_create_excerpt. My Site Wide Feed shows about 250 characters (not 55), although it does seem to be showing exactly 55 words. I’d like it to be more like 10-15 words…Any other ideas?


    mspecht
    Participant

    @mspecht

    ok it seems the comments around bp_create_extract are wrong it does 55 words it defines a word based on spaces. I tried changing the default $excerpt_length from 55 to 10 and my site wide activity only had 10 words.


    nicolagreco
    Participant

    @nicolagreco

    dont touch the code!

    Hacking the code is the last thing that you’ve to do with bp :)

    (I’m from mobile now, so i cant see it now) I’m sure that posts excerpts or forums ones have a filter, use them!

    after you’ve found the filter, use it writing a function to cut text, as i’ve done for forums and add that as filter.

    What is the filter?


    Archie Webmaker
    Participant

    @weblogian

    Where do I change the excerpt_length


    Archie Webmaker
    Participant

    @weblogian

    Here’s one option:

    I used advance excerpt Plugin https://wordpress.org/extend/plugins/advanced-excerpt/

    Activate and set the excerpt word number.

    and place the <?php the_advanced_excerpt(); ?> in the index.php

    This works for me.

    I am trying this plug too http://www.dailyblogtips.com/homepage-excerpts-wordpress-plugin/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hacking site wide activity…’ is closed to new replies.
Skip to toolbar