Skip to:
Content
Pages
Categories
Search
Top
Bottom

Child Theme/Functions

  • @nopartysystem

    Participant

    Hello, thanks for looking. I am using the most current versions of WP and BP. I have not linked my site here because it it still under development.

    I am having trouble getting the functionsphp in my child theme to work. I am trying to limit the activity loop, and have found the bp_has_activities function, but when I try to use it in my child theme I just get an error. I am very new to wordpress, and know it is something simple and stupid stopping me. This is all the that is in the child theme php….

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
    function theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }
    <?php if ( bp_has_activities( bp_ajax_querystring( ‘activity’ ).’&object=updates,posts,comments’ ) ) : ?>

    Can somebody please tell me what I’m doing wrong?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • @danbp

    Participant

    Hi @nopartysystem,

    Can somebody please tell me what Iā€™m doing wrong?

    in brief: all ! šŸ˜‰

    After you create a child theme, you’ll have a folder ‘my_child_theme’ and a unique file in it ‘style.css’

    If you want to modify BuddyPress, you create a folder named ‘buddypress‘ into your child-theme folder, and in this bp folder, you copy /folder/file/ you want to modify from /bp-templates/bp-legacy/buddypress/

    Read here for more details

    In your case, you use /child_theme/buddypress/activity/activity-loop.php

    Than you modify the code to reflect if ( bp_has_activities( bp_ajax_querystring....
    (read here)

    Another method to filter your activities is to use bp_parse_args (also explained on the codex)

    @nopartysystem

    Participant

    Thanks for the reply danbp,
    So, in short….
    1. create a buddypress folder in my child theme
    2. copy the code from activity-loop.php to it
    3. make the modifications in that folder

    Does that sound right? Do i need all of the code there, or just the ‘if…endif’ around the bp-has-activities function?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Child Theme/Functions’ is closed to new replies.
Skip to toolbar