Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp core load template vs bp get template part


  • James
    Participant

    @janismo

    Hi,

    theme: Twenty Fourteen, latest BP and WP.

    After theme compatibility ‘bp core load template’ doesn’t work anymore. Tried to use bp get template part, which works, BUT theme doesn’t accept my file as a page, what leads to the content + 404 below + css issues.

    Can anyone please explain in few words, how my custom file, e.g. bp_core_load_template(‘activity/index’) should be loaded now?

    I do see tons of discussions, but doesn’t see at least one simple explanation. thanks!

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

  • r-a-y
    Keymaster

    @r-a-y

    I’m guessing you have an older plugin that you want to support with the newer theme compatibility standard.

    Since you’re referencing bp_core_load_template( 'activity/index' ) in your example, I’m guessing you are trying to add theme compat for a new slug in the activity directory (eg. example.com/activity/new-slug/)? If so, you’ll want to copy the following code, rename the class and change a few things, so it is applicable to your plugin:
    https://buddypress.trac.wordpress.org/browser/tags/2.0.1/bp-activity/bp-activity-screens.php#L301

    Then you would load up your new class with the bp_core_load_template() call.

    if ( class_exists( 'BP_Theme_Compat' ) ) {
         new BP_Activity_WHATEVER_YOUR_CLASS_IS_CALLED_Theme_Compat;
    }
    bp_core_load_template( 'activity/index' );

    James
    Participant

    @janismo

    thanks, @r-a-y, will take a look on this.

    You are right re new slug, even more, question was raised because of those multiple outdated hashtag plugins available in repository. Recently I saw that you have rewritten very first of them.

    Could you tell if you have finished your update, or not? thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bp core load template vs bp get template part’ is closed to new replies.
Skip to toolbar