how do i create and reorder buddypress tabs

i have been playing with 2 plugins while trying to develop a cms backend based on buddypress.
one plugin lets me create new member profile tabs and reorder them but i can not run crucial shortcodes in them.

another plugin creates one and only one tab but it is widgetized and by changing some of its code i was able to reformat the widget size to be full page and it is great.

But it only creates one tab and i need many.

anyway these are the plugins:
http://wordpress.org/plugins/buddypress-custom-profile-menu/
BPCPM will not run the shortcode, even if just loading the page that renders the code.

http://wordpress.org/plugins/bp-my-home/
BP My Home does it perfectly but is limited to one tab.

i was told by the developer of custom profile menu that buddypress doesnt allow shortcode. obviously he is mistaken and when i pointed him in the direction of that plugin as proof he told me he had no plans to implement the function.

  • Patrick

    Hi there @PhilMay

    I hope you are having a great day!

    Those types of plugins are fun to play with, but if you want to add your own custom pages to BuddyPress profiles, you're better off coding them in yourself.

    To do so, you first need to define the functions that will set the top & sub level navigation elements and call the corresponding templates for the sub-pages. That is done in the bp-custom.php file that is then uploaded to your wp-content/plugins folder (it auto-activates itself when uploaded).

    I've attached a zipped copy of the bp-custom.php I use on one of my sites for a custom component like that.

    You'll see that there are calls in there for the sub-page templates that I've attached also. Those templates should be uploaded to the root of your current theme/child-theme.

    You can pop those files open to study how it's done.

    And you can most certainly use shortcodes in there like you can in any template with the do_shortcode function. I've included an example of how to use it in the page templates.

  • PhilMay

    I tried this out and it adds tabs perfectly so now i understand how that works, the shortcode displays perfectly. you really hit the nail on the head thank you.

    if i wanted to call a page that is created by shortcodes would that also work? just curious as it would enable me to create amazingly styled pages with many components because i could use my theme page editor to create it.

  • Patrick

    Hi again @PhilMay

    You can definitely execute multiple shortcodes in any way you like. It's a fully functional template built specifically for custom BuddyPress component pages.

    Below is an example of how to use multiple shortcodes. It's the base template I use for a private exercise program. You can see there are shortcodes in there from a plugin for an accordion style display (I use Shortcodes Ultimate for that), and there are those for forms (from Formidable Pro).

    echo '<div class="prepex">
    <h3>Week 1 – Life Inventory</h3>';
    echo do_shortcode ('[su_accordion]'.
    '[su_spoiler title="1 - Behavioral Patterns" style="simple"]'.'[formidable id=11 description=true]'.'[/su_spoiler]'.'[display-frm-data id=263 filter=1]'.
    '[su_spoiler title="Exercise 2" style="simple"]Content[/su_spoiler]'.
    '[su_spoiler title="Exercise 3" style="simple"]Even more content[/su_spoiler]'.
    '[su_spoiler title="Exercise 4" style="simple"]Even more content[/su_spoiler]'.
    '[su_spoiler title="Exercise 5" style="simple"]Even more content[/su_spoiler]'.
    '[su_spoiler title="Exercise 6" style="simple"]Even more content[/su_spoiler]'.
    '[su_spoiler title="Exercise 7" style="simple"]Even more content[/su_spoiler]'.
    '[su_spoiler title="Weekly Summary" style="simple"]'.'[formidable id=15 description=true]'.'[/su_spoiler]'.
    '[/su_accordion]');
    echo '</div>';

    So if you have a page builder that generates shortcodes for the output, you can use those in your templates to create awesome pages.
    .

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.