Search Results for 'how to hide pages'
-
AuthorSearch Results
-
June 28, 2015 at 5:23 am #241200
In reply to: Action Hook for bp-registration
Gnostic_Thought
ParticipantI am not sure. I bought a plugin from codecanyon and am trying to alter it to work with buddypress. I think this is the code I will have to alter
public function __construct() { $this -> admin = WP_Atr_Admin :: get_instance(); # registration hooks: add_action( 'login_enqueue_scripts', array( $this, 'initialize_registration' ) ); add_action( 'register_form', array( $this, 'add_checkboxes_to_registration' ) ); add_filter( 'registration_errors', array( $this, 'validate_registration' ), 10, 3 ); # mu add_action( 'signup_header', array( $this, 'initialize_registration' ) ); add_filter( 'wpmu_validate_user_signup', array( $this, 'mu_validate_registration' ), 10, 3 ); add_action( 'signup_extra_fields', array( $this, 'mu_add_checkboxes_to_registration' ) ); # add button add_filter( 'the_content', array( $this, 'add_button_to_pages' ) ); $this -> register_page_status(); if( is_multisite() ) { add_filter( 'all_plugins', array( $this, 'hide_plugin_in_mu_sites' ) ); } }I would figure I would prefix bp_ to some of the code here
# registration hooks:
add_action( ‘bp_login_enqueue_scripts’, array( $this, ‘initialize_registration’ ) );
add_action( ‘bp_register_form’, array( $this, ‘add_checkboxes_to_registration’ ) );
add_filter( ‘bp_registration_errors’, array( $this, ‘validate_registration’ ), 10, 3 );but it like there is more to it than that according to your link.
March 21, 2015 at 1:45 am #236306djsteveb
Participant@morka – do you have the same issue when using the default “wordpress 2014” or “twenty-twelve” themes?
If not, I would ask your theme author to add some kind of check on pages for something like “if is register page, turn off comments” / not load the comment hook thing…sorry not a php or wp/bp expert, can’t point you in the right direction for those codes and what they are really called. I know with some standard WP pages you can go into the editor and select “comments off / disable trackbacks” – and with some themes you can use a theme option to “display comments off” or hide “comments off” on pages where comments are disallowed.
March 18, 2015 at 8:28 am #236183danbp
ParticipantHi,
searching the forum before asking is sometimes more efficient. 😉
https://buddypress.org/support/topic/title-of-pages-not-correct/
March 13, 2015 at 12:10 am #235919rosyteddy
Participant@minglonaire you can also try https://bp-tricks.com/design/easily-hide-specific-tabs-on-buddypress-member-and-group-pages/ AND remove Activity from Themes > Menu in your wordpress admin dashboard
March 12, 2015 at 10:53 pm #235911danbp
ParticipantTry this to remove ALL activity feeds
function bpfr_hide_rss_feeds() { remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ); remove_action( 'bp_actions', 'bp_activity_action_friends_feed' ); remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); remove_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); remove_action( 'groups_action_group_feed', 'groups_action_group_feed' ); } add_action('init', 'bpfr_hide_rss_feeds');This snippet will only show logged in users friends activities (on all activity pages of the site)
function bpfr_filtering_activity( $retval ) { $retval['scope'] = 'friends'; return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );Add to bp-custom.php or child-theme functions.php
More details about this on Codex
March 4, 2015 at 9:10 pm #235465In reply to: Profile menu visibility
danbp
Participantmy snippet hides buddybar items to non logged user, not BP usermenu items on Toolbar.
To do that, you have to read the codex document i indicated in one of previous post.
BuddyMenu is built a la BuddyPress. And you got support for this here.
Toolbar is built a la WordPress. WP support is here.
If you had looked a little on the forum (ie. Remove Edit My Profile), you could find this:
https://buddypress.org/support/topic/remove-edit-my-profile/#post-150939And again, the one or other code doesn’t remove BP pages, only items.
February 11, 2015 at 11:02 am #234287In reply to: version 2.2.0 and is_page() [Resolved]
Toby
ParticipantActually I should clarify, this isn’t happening on members or groups index pages. It’s subpages of these. It seems to be something to do with get_queried_object()? I’m starting to show my hideous ignorance at this point though.
February 1, 2015 at 2:58 pm #233352In reply to: [Resolved] How To Get Notification Count? (Code)?
chatty24
Participant@danbp
I have edited the code a bit and now it is getting displayed on all the pages as I wanted but, How can I hide the modified title when the notification count is 0. By current code is below –function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation ) { global $bp; if( bp_is_user() && ! bp_get_member_user_id() ) { $user_id = 'displayed: '. bp_displayed_user_id(); } else { $user_id = 'get_member_user: '. bp_get_member_user_id(); } if (bp_notifications_get_unread_notification_count( $user_id ) ) { $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { echo $notifications[$i]; $counter++; } $title = "You Have " . bp_notifications_get_unread_notification_count() . " New Notification(s) - "; return $title; } } add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 9, 4 );Thanks
January 22, 2015 at 12:06 am #232723screampuff
ParticipantThanks for the reply. I made some changes to the code before reading and was able to accomplish removing the tab from buddypress profiles with this:
function hide_achievements_from_users() { global $bp; if ((bp_loggedin_user_id() == bp_displayed_user_id()) || (current_user_can('administrator'))){ return; } bp_core_remove_nav_item('achievements'); } add_action( 'bp_setup_nav', 'hide_achievements_from_users', 99 );However I’m stuck on how to 404 the pages if they manually type out the URL
In your code I see:
// I guess we should 404 this page because this member isn't an admin or the displayed member. $wp_query->set_404(); status_header( 404 ); nocache_headers();How do I get this to apply only when it is http://mysite.com/members/<username>/achievements?
December 25, 2014 at 9:24 pm #231036In reply to: Buddybar issues with wordpress 4.1
danbp
ParticipantTempera theme was recently updated and normally you haven’t to use the old buddybar.
So the define is of no utility… (see ticket)BP use now the WordPress Toolbar.
It looks also that you have 2 activity pages, 2 members page and 2 groups page. There should be only one. See if you have deleted pages, and clear the trash.
Also set up the pretty permalinks (anything but default), or at least re-save that setting page.Finally, make a test with one of wp’s default theme, bring anything to work, before activating Tempera.
I use another theme of the same author, and if like i suspect, there is the same theme customization tool in Tempera, you must be carefull with that theme settings.
In BP settings, you have an option to show/hide the toolbar to logged out user. Deactivate it.
And read the theme doc attentively ! 😉
November 19, 2014 at 8:30 am #229185mcpeanut
Participant@izzyian, I believe if you use the code above it will also remove the Whats new form from your main activity stream too! If you want to hide it from just the profile pages i suggest trying this code.
div#item-body form#whats-new-form {
display: none;
}Hope this helps
October 17, 2014 at 5:06 am #215432mahdiar
ParticipantThanks .
I read those pages before . The first one is about 9 month ago and it is closed to new replies . I can’t find any solution there .
The second one is about how to hide comments completely in activity stream but it’s nice to see them just by one click on the activities .September 17, 2014 at 4:11 pm #197257In reply to: New problem i havent seen before?
danbp
ParticipantThe problem is with the hiding of activity comments
How did you hide activities comment ?
Default wp/bp install let you add 5 (nested) comments only. And all comments are shown on SWA. If you have 100 you have to scroll them, yes.
I’m unable to reproduce your issue.Try this bp settings:
check profile syncing
check activity stream commenting for blog and forum
check automatically check for new itemswp discussion settings
uncheck Enable threaded (nested) comments
uncheck Break comments into pagesSeptember 13, 2014 at 3:54 pm #193476In reply to: [Resolved] Customise register page
danbp
ParticipantThe field NAME in the field group BASE is required. This group is used for the registration page to work. As you already know, it’s also this group who allows you to show custom fields on the registration page.
The NAME field in BuddyPress is intended to receive first and last name and replace the two original fields (first name, last name) coming with WordPress.That said, you can hide this field to users, but you can’t give them the choice to show/hide it.
The above snippet will hide the field NAME to all visitors/members, but not to site admin and the concerned profile.
function bpfr_make_name_members_only( $retval ) { //hold all of our info global $bp; // is xprofile component active ? if ( bp_is_active( 'xprofile' ) ) // The user ID of the currently logged in user $current_user_id = (int) trim($bp->loggedin_user->id); // The author that we are currently viewing $author_id = (int) trim($bp->displayed_user->id); // user can see only his name && admin can see everyone if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) { $retval['exclude_fields'] = '1'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );Add this to your child-theme functions.php or to bp-custom.php
August 9, 2014 at 8:53 pm #186374In reply to: No option to Select who sees Name in Profile Field
August 1, 2014 at 11:16 pm #185851In reply to: Hide admin from member list
pstidsen
ParticipantHi danbp
I have now inserted all of your code in functinos.php, but the only place the admin user disappear is at the “All users”-page. The admin user still shows up at the group members pages and the front page where I have listed all members with the Bowe code plugin.
I need to hide the admin from the entire site.
July 23, 2014 at 2:58 pm #185464In reply to: $bp->bp_options_nav wrong user links
jejemo
ParticipantThanks for you help !
Actually I hide the admin bar on my pages. That’s the reason why I’m trying to build the exact same menu on another navigation bar.
I feel like it is a bug because here, it says that :
$bp->bp_nav “is the array used to render each component navigation menu item for the logged in user”
and
$bp->bp_options_nav “is the array used to render all of the sub navigation items for the $bp->bp_nav array”.
Actually I feel like I’m having the result of $bp->bp_users_nav.
Because it “is the array used to render each component navigation menu item for the displayed user (when you view a user that is not you).”What do you guys think ?
July 19, 2014 at 2:33 am #185279foresme
ParticipantHello! I’m using the Membership plugin by WPMU.
Will the private bp pages plugin hide member activity from Google listings?
Thank you 🙂
May 20, 2014 at 11:03 pm #183167Tbarnes37
ParticipantHi @soran7
I’ve narrowed the problem down further and found a hack that works for me. If you look in buddypress-functions.php, there’s a function at line 739 called bp_legacy_theme_new_activity_comment. At line 770 is the process of inserting the new comment into the activity stream.
It begins by checking if $activities_template->activities[0] is set. I’ve tested this function on an actual group page and found that this returns true, so it’s able to handle the activities effectively. However, on my custom template, this returns false; thus, the new comment data is never inserted. Of course this is separate from the process of saving the new comment to the database, so it makes sense that the comments still show up after refresh.
I’m still hoping to find a less hacky way to do this, because my current solution messes up other activity stream pages, but I’ve managed to get my custom template working by copying buddypress-functions.php into my theme folder and modifying line 768 to have a ‘groups’ scope.
So change line 768 from this:
bp_has_activities( 'display_comments=stream&hide_spam=false&include=' . $comment_id );to this:
bp_has_activities( 'scope=groups&display_comments=stream&hide_spam=false&include=' . $comment_id );Hope that helps! And if you’re able to find a better, less damaging way, please let me know. My hangup currently is that even if I manually set $bp->current_action to ‘groups’ in my template, it gets over-written at some point after page load, due to a url check that finds my template to not be at a group home url.
February 14, 2014 at 9:58 am #178386Jen
ParticipantHi I’m wanting to just hide member profile pages, but keep all other BuddyPress pages public. I tried this code in my bp-custom.php, but it doesn’t work. Any ideas?
/* Prevent logged out users from accessing bp profile pages */ function nonreg_visitor_redirect() { global $bp; if ( bp_is_profile_component() { if(!is_user_logged_in()) { //just a visitor and not logged in wp_redirect( get_option('siteurl') . '/register' ); } } } add_filter('get_header','nonreg_visitor_redirect',1);December 23, 2013 at 6:48 pm #175992In reply to: Group Fun and Games
bowoolley
ParticipantI’m all for fun and for personalising group activities! I’m thinking of adding polls and quizzes, but I don’t like adding tabs to the group page – I have actually been trying to avoid sending users (many of whom are somewhat grouchy about technology) to the default group pages (which look sort of 1999, even in my estimation.) So I’m playing with ways to hide the default group page and create a separate “space” for each group (without going MU.) I’ll follow this thread with interest, and post if I find something useful!
November 24, 2013 at 12:30 am #174704In reply to: Buddypress on Mobile / Hide admin access
mattg123
Participant@pjbursnall yeah that code replicates the notification element only (the only part that is somewhat confusing to replicate) you place the code in the plugins directory in bp-custom.php you may have to create the file yourself.
http://stackoverflow.com/questions/9953482/how-to-make-a-pure-css-based-dropdown-menu – shows you how to create a drop down menu, https://codex.wordpress.org/Function_Reference/get_currentuserinfo get the current users info so you can create links to their profile pages, etc.
Just a note, to add the notifcations to your custom bar your code will look something like
<li><?php bp_notification_badge(); ?></li>October 22, 2013 at 8:47 pm #173237In reply to: [Resolved] Buddypress Pages Post ID
mizzinc
ParticipantSimple styling options. Show/Hide page title, breadcrumbs, feature image?
Hmm, after reading your extended response, perhaps I am approaching this from the wrong angle.
October 5, 2013 at 6:30 pm #172349In reply to: Feature request: Hide certain members
robotnjik
ParticipantI have similar request. We would like to exclude admins from groups. We set that only admins can create groups and now all groups have admin for a member. It is ok to have admin activity listed but we would like to hide admins from member listings on group pages. Is this code or part of code work on BP 1.8.1.?
September 13, 2013 at 11:01 pm #171313danbp
Participanthi @valuser,
the bp_is_blog_page function is missing to hide the calendar when on BP pages.
The place with the weird output contains an overcomplicated method to show a title. IMHO there is no need to use so many conditionnals to show a post title…. So I replaced it by the h1 stuff used in Twenty Thirteen.
You will probably need some adjustment into CSS too. So far i can see there is no other trouble with BP. Nice theme !
remove/replace the following into /partials/part_article_header.php
<?php // Article calendar if ( bp_is_blog_page() ) : // if it returns true, it's not a BP page. if (!is_page() && !is_search()) : ?> <div class="calendar event_date"> <span class="month"><?php echo strtoupper(get_the_date('M')); ?></span> <span class="day"><?php echo get_the_date('d'); ?></span> <span class="year"><?php echo get_the_date('Y'); ?></span> </div> <?php endif; endif; // ending bp_is_blog_page ?> <h1 class="entry-title"> <?php if ( is_single() ) : ?> <?php the_title(); ?> <?php else : ?> <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a> <?php endif; ?> </h1> -
AuthorSearch Results