Skip to:
Content
Pages
Categories
Search
Top
Bottom

Include common elements from bphome in bpmember theme


  • peterverkooijen
    Participant

    @peterverkooijen

    How can I include elements from the bphome theme folder in bpmember theme files?

    I have a navigation.php in the bphome theme. I want to use the same file in the bpmember theme. The only way I was able to get it to work is by using the entire server path. Like this:

    ‘<? include ‘/entireserverpath/mywebsite/wp-content/themes/bphome/navigation.php’; ?>’

    There must be a better way, probably with something like TEMPLATEPATH etc. I’ve also tried dozens of variations of ../ or ././ or …/…/. Couldn’t figure it out.

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

  • Burt Adsit
    Participant

    @burtadsit

    Well, you could always encapsulate the navigation.php code into a function and just call that function from both places.

    funciton my_nav_stuff(){

    ?>

    .. all the stuff from navigation.php…

    <?php

    }

    Stick that in bp-custom.php then in both themes <?php my_nav_stuff() ?>

    The template path gets hijacked when a user goes into the member theme. It gets set to /bp-themes. When they go out of it it’s back to normal again /themes. That wouldn’t work for pointing to a file.


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks! That’s pretty straightforward. I’ll use that a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include common elements from bphome in bpmember theme’ is closed to new replies.
Skip to toolbar