Skip to:
Content
Pages
Categories
Search
Top
Bottom

Editing the Blogs/Groups/Members/Forum pages?


  • dwpers
    Participant

    @dwpers

    How does one go about adding the different pages? I would like to add some custom content, but when I open bp-blogs.php bp-groups.php etc, I don’t see any place to ad the content I would like to.

    I’m looking to ad custom content under the right column that random users, blogs, etc show up.

    I’m running BP 1.1.3

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

  • r-a-y
    Keymaster

    @r-a-y

    add_action() is your friend.

    No need to edit the templates directly.

    For example, to add custom content after the random blogs:

    Add this to /wp-content/plugins/bp-custom.php:

    function my_custom_content_after_random_blogs() {
    echo 'MY CONTENT AFTER RANDOM BLOGS';
    }
    add_action('bp_after_directory_blogs_featured', 'my_custom_content_after_random_blogs');

    How do you find these actions? Look for do_action() code in your /wp-content/themes/bp-sn-parent/directories/COMPONENT/index.php.


    dwpers
    Participant

    @dwpers

    So HTML and script objects will work fine with this method? Also, I don’t see how this will specify it to be underneath the random blogs listed on the blog directory in the right column.

    I’ll give it a go, but I want to understand what I’m doing :D.

    EDIT: Thank you for the directory structure for the components, if I can’t figure out your bp-custom method, I’ll be able to do it directly.


    r-a-y
    Keymaster

    @r-a-y

    Also, I don’t see how this will specify it to be underneath the random blogs listed on the blog directory in the right column.

    This is the magic:

    add_action('bp_after_directory_blogs_featured', 'my_custom_content_after_random_blogs');

    This tells the “bp_after_directory_blogs_featured” do_action part of code in /wp-content/themes/bp-sn-parent/directories/blogs/index.php to plug in your custom code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Editing the Blogs/Groups/Members/Forum pages?’ is closed to new replies.
Skip to toolbar