Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'theme'

Viewing 25 results - 16,951 through 16,975 (of 31,071 total)
  • Author
    Search Results
  • #124487
    @mercime
    Participant

    Cool, glad it worked out for you :-)

    Method 1 works all the time for all WP themes, while method 2 works for some WP themes depending on HTML structure.

    Method 2 in short, uses the WP functions available for themes. Look at /activity/index.php and you’ll see header(‘buddypress’), sidebar(‘buddypress’) and footer(‘buddypress’) in the template files. If there’s a header-buddypress.php, in the WP/BP theme folder, then the BP template file would use header-buddypress.php. If there’s none, then the BP template file would use header.php by default.

    TMA works with either method 1 or method 2. I gave the solution for method 2 because the HTML structure of TMA was suitable for that. Method 2 saves you from having to “fix alignment” for 16 BP template files again (which you have to do in method 1) when the BP Template Pack plugin is upgraded.

    #124480
    dude
    Member

    the mobile menu is just for the mobile version of the site via the buddypress mobile plugin
    I don’t want the mobile menu being ‘hidden’ from logged-out mobile users really, mainly desktop users.

    I’ve put some mods in the activity-loop etc for keeping activity updates, profiles and members, groups, and forum directories ‘garden-walled’ as such so may have that angle covered?

    #124479
    aces
    Participant

    I’m not sure what you mean – but according to https://codex.wordpress.org/Function_Reference/wp_nav_menu you could have ` ‘fallback_cb’ => false,`

    I don’t know how you are doing the mobile menu, but couldn’t you just have $current_user logged in and out mobile menus?

    If someone can guess the page such as activity, then just hiding the menu won’t stop them getting in anyway.

    #124478
    dude
    Member

    @aces just had a thought! instead of calling up the ‘secondary-menu’ would it be possible to void out / null the request to fallback on no menu at all..?

    i.e. – => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘no-menu’, ‘fallback_cb’ => ” ) );

    or – => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘//’, ‘fallback_cb’ => ” ) );

    #124473
    dude
    Member

    single menu..?

    I really think I gotta create the third theme location first, because the fall-back call will end up showing logged-out visitors my mobile menu which is a duplicate of the primary location so in theory my menu tabs will still be on display

    #124471
    3dperuna
    Participant

    Figured it out… incompatible plugin (Theme-My-Profile, for what it’s worth). Deactivated it and the world returned to normal*.

    * Realize that “normal” is a relative term.

    #124468
    jugularbean
    Participant

    @mercime – great! it worked. Thanks a ton. Still some styling to do, but it’s working yay!

    Could you however help clarify why method 2 worked over 1. And how does method 2 work exactly?

    #124467
    @mercime
    Participant

    @jugularbean Re #1 – thanks for clarifying, just had to make sure :-)
    2. You don’t change the filenames, you replicate the file/s and rename as header-buddypress.php etc and should be saved in root of your TMA theme folder.

    You’re in luck. We can use the second method to make TMA compatible with BuddyPress.

    1. Open up TMA’s header.php with text editor and Save As > header-buddypress.php in TMA theme folder

    2. Open up header-buddypress.php and add the following at the very end of the file:
    `<?php global $woo_options;
    //get_template_part( ‘top-banner’ );
    ?>

    `

    Save file.

    Note: if the global woo_options wreaks havoc, delete from the code

    3. Open up TMA’s sidebar.php and Save As > sidebar-buddypress.php in TMA’s theme folder

    4. Open up sidebar-buddypress.php

    a. At the very beginning of the file, insert
    `

    `
    b. At the very end of the same file, insert
    `

    `

    Save file.

    5. You might want to tweak the default styling of the BP template files. You can use the following style changes used in Twenty Ten theme as a guide https://codex.buddypress.org/theme-development/theme-dev-bp-template-pack-walkthrough-twenty-ten-bp-1-5/3/

    #124455
    johnegg
    Participant

    Ok something very strange going on. I did a fresh install of wordpress & deleted tables in database. Went in to WP admin and all ok. Went to ‘Settings – reading’ and I can see that I can select homepage & blog page using dropdown.

    However as soon as I activate buddypress and go back in to ‘Settings – reading’ the dropdown to select static homepage is no longer there! This is obviously related to my above problem with no page dropdowns within buddypress settings.

    Also any pages I create are not showing up in my themes navigation menu. Its as if WP is not reading any pages I create and treats it as if I have no pages.

    If I deactivate buddypress the problems persists and i need to delete database again.

    Please can anyone help with this?

    #124446
    jugularbean
    Participant
    #124445
    jugularbean
    Participant

    @Mercime

    1. Yes the theme was already activated when I installed and activated the BP template pack and ran the BP Compatibility.
    2. I’ve been trying to use the first method without much success. To be honest I didn’t understand the 2nd method. After I change the filenames where do I save the new files (header-buddypress.php etc)?

    #124433
    Paul Wong-Gibbs
    Keymaster

    You must have another plugin, or theme option, affecting it.

    #124428
    aces
    Participant

    I’ve just tried the following on a bp test site instead of the single menu and it worked
    `
    <?php
    if ( is_user_logged_in() ) {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ” ) );
    } else {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘secondary-menu’, ‘fallback_cb’ => ” ) );
    }
    ?>
    `

    nb: The test site is also using the walled garden technique…

    #124427
    dude
    Member

    just realized I’ll have to make up a third theme location to pull this one off :( when does the editing ever end lol

    #124426
    dude
    Member

    good point !
    can’t afford any more site breaks on a flourishing community

    I take it my initial plan A is not worth pursuing then?

    It does address both menus specifically speaking..

    #124425
    aces
    Participant

    It would help if you had a test site to try it out on, ie: localhost or a subdomain…

    #124424
    dude
    Member

    customized bp-columns? sounds interesting !

    does the fact that I have the secondary navigation as the mobile version of the site make any difference? just got this gut feeling that this may just fail unless I call the secondary the logged-out-menu as my theme at present only supports 2 menus.

    #124423
    aces
    Participant

    I’m using a customised bp-columns, which is mostly the same as bp-default.

    I would just replace
    `wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ) );`
    which begins and ends with php tags with the above also wrapped in php tags….

    the mobile angle is something else…

    #124422
    dude
    Member

    ok gonna give it a try (fingers crossed)

    I’ll pop it in my child themes header.php (bp default 1.5.1)

    any particular nesting point..?

    #124421
    aces
    Participant

    Actually I think it should, but I didn’t try it as I was already experimenting with the above for a non bp site and tried it out on a bp test site and it worked.

    I quite like this approach because you could also use the data (see link) to do other things as well…..

    #124419
    dude
    Member

    hi @aces !

    thanks for the alternative option

    does your post imply that the example I’m trying to use will NOT work then.?

    by the way I have 3 menus in place:

    primary navigation – logged-in-menu

    mobile menu – mobile (buddypress mobile)

    logged-out-menu

    #124413
    aces
    Participant

    How about the following (in the header?) instead of what’s there (bp 1.5.1)
    `// https://codex.wordpress.org/Function_Reference/wp_get_current_user
    $current_user = wp_get_current_user();
    if ( 0 == $current_user->ID ) {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘secondary-menu’, ‘fallback_cb’ => ” ) );
    // Not logged in.
    } else {
    wp_nav_menu( array( ‘container’ => false, ‘menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ” ) );
    // Logged in.
    }
    `
    ? (wrapped in “ tags)

    #124412
    dude
    Member

    okay so I’ve done some digging and found – nav-menu.php
    copied it to my child themes folder and created two seperate menus in my admin dashboard.

    I found this code for the menu config: here: https://codex.wordpress.org/Function_Reference/wp_nav_menu


    `<?php
    if ( is_user_logged_in() ) {
    wp_nav_menu( array( ‘theme_location’ => ‘logged-in-menu’ ) );
    } else {
    wp_nav_menu( array( ‘theme_location’ => ‘logged-out-menu’ ) );
    }
    ?>`



    Am I getting warm..?

    If so, just two questions remain..

    a) where in: nav-menu.php do I add the above code..?

    b) Does the above code need to be wrapped at all..?

    Kind regards in advance :)

    @mercime
    Participant

    `’menu_id’ => ‘nav’, ‘theme_location’ => ‘primary’, ‘fallback_cb’ => ‘bp_dtheme_main_nav’ ` pertains to the adoption of the wp_nav_menu function which allows users to create their own menu. This falls back to wp_page_menu and bp_nav_menu.
    https://codex.buddypress.org/extending-buddypress/how-to-set-up-your-main-site-navigation-using-the-built-in-wordpress-menus/

    Goodbye, headaches. Hello, menus!

    #124405
    junglejinge
    Member

    I have followed these instructions in modifying the stylesheet (style.css) but despite this, the results are still the same. http://www.meetinbradford.org/groups/x/

Viewing 25 results - 16,951 through 16,975 (of 31,071 total)
Skip to toolbar