Search Results for 'custom activity page'
-
Search Results
-
Topic: Target only profile page
How can I either write a function, or create a custom template that is only used for the users main profile page?
The way buddpress works by default, all of the various profile sub-pages seem to use the same exact template.
For example, I want to specifically target domain.com/username (which we have as the main profile page).
Do NOT want to target, domain.com/usersname/friends, domain.com/username/followers, domain.com/username/activity etc.
I need to add some custom data to only the main profile page, and not have it trickle down to the subpages…
The New Feature in Buddypress Starred button redirects users to their post page button. I’ve added a button to users buddypress activity page which is titled Post that takes users to a page with a list of their Posts made to WordPress. With the new update when you click on the Starred button the user is redirected to the the list of posts. I created the Post button using this custom function I found Online.
/* ——————————Start BP Post in profile code for function——————– */
function importSomething(){
return include_once ‘bp-custom.php’;
}
add_action( ‘bp_setup_nav’, ‘buddyboss_child_bp_nav_adder’ );
add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );function buddyboss_child_bp_nav_adder() {
global $bp;
$post_count = count_user_posts_by_type( $bp->displayed_user->id );
bp_core_new_nav_item(
array(
‘name’ => sprintf( __( ‘Posts <span>%d</span>’, ‘my-poems’ ), $post_count ),
‘slug’ => ‘Articles’,
‘position’ => 250,
‘show_for_displayed_user’ => true,
‘screen_function’ => ‘buddyboss_child_list’,
‘item_css_id’ => ‘articles’,
‘default_subnav_slug’ => ‘public’
));
}
function buddyboss_child_list() {
add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
/*——- This is end of the code for above function ———*/
function profile_buddyboss_child_loop() {
$myposts = get_posts( array(
‘posts_per_page’ => -1,
‘author’ => bp_displayed_user_id(),
‘post_type’ => ‘post’
));
if( ! empty($myposts) ) {
foreach($myposts as $post) {
setup_postdata( $post );
if (has_post_thumbnail( $post->ID ) ):
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘sidebar-smallthumbnew’ );
else :
$image[0] = “…/wp-content/themes/Starkers-Child-2/images/vidimage.jpg”;
endif;
echo ‘<li class=”sidebar mostpop post-‘ . $post->ID . ‘”><div id=”postimage”>ID) . ‘”></div><div id=”postinfo”>ID) . ‘”>’ . get_the_title($post->ID) . ‘</div>‘;
}
echo ‘‘;
wp_reset_postdata();
} else { ?>
<div class=”info” id=”message”>
<p><?php bp_displayed_user_fullname(); ?> has No posts.</p>
</div>
<?php }
}
/* This is end of the code for above function */
remove_filter(‘bp_setup_nav’,”);
function count_user_posts_by_type( $userid, $post_type = ‘post’ ) {
global $wpdb;
$where = get_posts_by_author_sql( $post_type, true, $userid, true);
$count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
return apply_filters( ‘get_usernumposts’, $count, $userid );
}
/* ——————————This is end of the code for post in profile above function——————– */I dont want to get rid of the latest starred button feature, so How can I go about correcting this redirect error.
Also the new mobile take picture update doesn’t work on the mobile version of my site. I’m using WP-Smart mobile plugin to generate a mobile theme. I also have a copy of Buddypress in both my Child Theme and my active WP smart mobile theme.
How can I go about fixing these issues if possible.
Also, great exceptional work on these new updates.
Thank you
Hello,
I am quite new to wordpress and buddypress, however i am not new at troubleshooting. I have everything installed per the documentations and ensured its proper working functions with the default 2013 theme un-customized. i then installed a custom plugin to show player stats for an online game. In all themes when going to http://brassmonkeymilitia.net/sitev2/bf3-player-stats/ this page and clicking on details the lightbox pops up behind the theme, however In my troubleshooting i disabled all plugins except this custom one and it worked as it should so i then 1 by 1 enabled plugins and tested the page clearing the cache and reloading the page each time (exhausting as it was….) once i enabled the buddypress plugin it started popping up behind the theme once again. I then went into the settings of buddypress and disabled all components with the exception of the 2 core ones. and tried the page again now it works as it should. so 1 by 1 i enable the components until i get to the activity stream and viola here inlays the problem (yes i disabled the activity stream and continued to test until all other components were enabled.). I would like to have the activity stream working as well as my player stats. what can i do? i do know from some initial searching that having multiple lightbox operators can cause some unwanted issues. does the activity stream utilize a self contained lightbox addon that could be interfering with the themes built in lightbox?WP ver:4.2.2
BP ver:2.2.3.1I am trying to rearrange the buddypress profile menu items with the bp-custom.php file located in WP-Admin > WP-Content > plugins.
The following code I have is as follows:<?php // hacks and mods will go here function mb_profile_menu_tabs(){ global $bp; $bp->bp_nav['media']['position'] = 10; $bp->bp_nav['activity']['position'] = 15; $bp->bp_nav['forums']['position'] = 15; $bp->bp_nav['profile']['position'] = 25; $bp->bp_nav['messages']['position'] = 30; $bp->bp_nav['notifications']['position'] = 40; $bp->bp_nav['friends']['position'] = 50; $bp->bp_nav['groups']['position'] = 60; $bp->bp_nav['orders']['position'] = 70; $bp->bp_nav['profile']['name'] = 'Account'; $bp->bp_nav['forums']['name'] = 'Collections'; } add_action('bp_setup_nav', 'mb_profile_menu_tabs', 201); ?>When I save the file and then refresh my profile page the items are not rearranged or renamed. Am I missing any steps or do i need to copy this document and paste it elsewhere inside other .php files?
Any suggestions will be helpful! (:Hello @imath,
I was following your thread ( https://codex.buddypress.org/plugindev/post-types-activities/#adding-the-buddypress-support-and-specific-labels-at-post-type-registration) on how to add a custom post type support to the activity stream. I’m currently using WP 4.2.1 and BP 2.2.3.1, with a multisite — directory folder setup.
I created a custom-bp.php file and uploaded it to my plugins folder and added the code you had for the CPT “pages” on the thread link above. This is the error I got:
“Parse error: syntax error, unexpected T_FUNCTION in /nas/wp/www/staging/mcs2/wp-content/plugins/bp-custom.php on line 6”
My goal is to add a custom post type called OFFER to the activity feed using your directions in the thread above. Can you help me with this please?
Thanks
Topic: Where are loops put?
Hi everyone,
Where are loops such as the Standard Loop in the link below put?
https://codex.wordpress.org/The_Loop_in_ActionDo they go in the bp-custom.php file? How are they called into use on a new page?
Any help/guidance of where to look would be appreciated.