Forum Replies Created
-
thanks, for now I resolved using wordpress function get_avatar( $id)
Solved!! 🙂
I view this post https://buddypress.trac.wordpress.org/ticket/5373
and I changed database field value.Solved !! 🙂
Maybe there was a faster, simpler code, but I have done so (if anything serves to someone):$current_user = wp_get_current_user(); $userID = bp_displayed_user_id(); $userURL = bp_core_get_username($userID); $current_user= $current_user->user_login; if ($current_user == $userURL) {...}
😉
Update: i remember … I modified the file cover-image-header.php adding a sinple code with link
<div class="generic-button" id="generic-buttonid"><a href="http://mysite?page=swap" class="" id="button-1" rel="">Gestisci Swap</a></div> <div class="generic-button" id="generic-buttonid"><a href="http://mysite?page=newswap" class="" id="button-1" rel="">Aggiungi Swap</a></div>
I need to put it into a IF statement that says “if my profile is then display them”… there is a variable to see if the profile is mine or that of others? thanks
Thank you!
I solved it by acting directly on the plug-in code BuddyPress Custom Profile Menu and changing the position of the slug and the display for all user.
But soon as I get the chance I’ll try with the custom code without using plugins (many would give more satisfaction!). Thanks!
It’s OK. I resolved It!!! 🙂
I have a certain page “Swap” full of functions and associations to other pages formed by a plugin called “swap”. I must associate this page to BuddyPress menu.
I tried BuddyPress Custom Profile menu’s plugin and made me properly create my swap page, but: 1) remains as the last position, and I would like the first; 2) I will only appear on my profile as I would like for all of the users.
So not good.As an alternative, I tried to create through my code menu item (and I can put it in first position and for all users) with the code inside of swap page, just as there are php functions related to other non correctly display the content. Because my template is in the folder of my theme BuddyPress child, and to make it work well should I leave it in my folder of the swap plugin. (Ie wp-content / plugins / swap / front / views)
My question is: how do I make the point to all there in that folder? it is feasible? Or is feasible to act on the plugin configuration BuddyPress Custom Profile Menu and resolve the position and visibility for all? thanks
Simple. I want to make functional code
My actual code is:
function bpfr_custom_profile_sub_nav() { global $bp; $parent_slug = 'activity'; //Add subnav item bp_core_new_subnav_item( array( 'name' => __( 'Swap' ), 'slug' => 'swap', 'parent_url' => $bp->displayed_user->domain . $parent_slug.'/', 'parent_slug' => $parent_slug, 'screen_function' => 'swapluisa', 'position' => 1, ) ); } add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' ); function swapluisa() { add_action( 'bp_template_title', 'my_groups_page_function_to_show_screen_title' ); add_action( 'bp_template_content', 'my_groups_page_function_to_show_screen_content' ); } add_action( 'bp_setup_nav', 'my_bp_nav_adder', 50 ); function my_groups_page_function_to_show_screen_content() { return bp_get_template_part('members/single/swap'); // (OR THIS???) return bp_get_template_part('wp-content/themes/betheme-child/buddypress/members/single'); } function my_groups_page_function_to_show_screen_title() { echo 'My new Page Title'; } function luisa_register_template_location() { return 'members/single/'; // (OR THIS????) return 'members/single/';wp-content/themes/betheme-child/buddypress/members/single' } function luisa_template_start() { if( function_exists( 'bp_register_template_stack' ) ) bp_register_template_stack( 'luisa_register_template_location' ); } add_action( 'bp_init', 'luisa_template_start' );
but dont’work!
I repeat, surely accidentally pointing to the folder, I can not figure out the exact solution. when i write “OR THIS??” i try but don’t work.
where am I wrong? thanks
I do not want to regurgitate, but really, for me not knowing English well is very difficult to understand and the last posted code returns as explained to me at the beginning and that is that if I enter the submenu item not like the whole thing works but if I want to insert the voice within an existing tab I change something and I can not understand what. I don’t undersatand.
I beg you, please, if you can give me extra help, this time.
They are days that are on this issue and I can not go on, I am also physically ill and I can not concentrate on the solution, please … a little help more!sorry 🙁 i don’t know!!!
I seem to do correctly, but does not work.
I also for testing entered my files everywhere, but does not find it anywhere !!!In my web-site the URL is
http://mysite.it/membri/testmember1/activity/swap/
but it says “We are sorry, but the page you are looking for does not exist.”I have my swap.php (into there’s only a echo command)’s file in
wp-content/themes/child-theme/buddypress/members/single/
and inbp-custom.php
(that is in my plugin folder) I writefunction my_groups_page_function_to_show_screen_content() { bp_get_template_part('members/single/swap'); } function luisa_register_template_location() { return 'wp-content/themes/betheme-child/buddypress/members/single'; }
I try also to put the swap.php file into
wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single
but nothing is happen.where am I wrong? thanks
thanks but it don’t work, or better… I don’t know where is my template folder… I’m confused on the right folder… I inserted the code in my file bp-custom.php on the theme’s plugin folder.
Where I have to create my own template? in my child theme? or under the buddypress ‘s plugin folder?? Or where?
can you do me a practical example of how to enter the correct URL?
You can also explain the function of the code you quoted?
thank you