Hello Daniel,
Try the following code in your “bp-cutom.php” file.
/** * Modify New Post tab link * * @param array $subnav Subnav item array. * * @return mixed */ function buddydev_modify_new_post_tab_link( $subnav ) { $subnav['new-post']['link'] = 'https://google.com'; // Replace URL with yours return $subnav; } add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );
Thank You
RaviHi Ravi,
I have applied the code but it is not working.
Do I need to enter the link to the post page without the tick ? Means https://google.com instaead of ‘https://google.com’ ?
Thank you.
Regards,
DanielHi Ravi,
Also, when clicking on the New Post tab, I get still redirected to this URL: https://mywebsite.com/members-2/mywebsite/buddyblog/edit/
Thank you for your assistance.
Regards,
DanielHello Daniel,
Are you using your link inside '' this string. For example.
$subnav['new-post']['link'] = 'https://google.com';
Please check and let me know.
Thank you
RaviHi Ravi,
I have tried to put the code into bp-custom.php but when clicking on the “New Post” Tab, then it still does not redirect but I receive a 404Error saying page not found.
/** * Modify New Post tab link * * @param array $subnav Subnav item array. * * @return mixed */ function buddydev_modify_new_post_tab_link( $subnav ) { $subnav['new-post']['link'] = 'https://mywebsitelink.com'; // Replace URL with yours return $subnav; } add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );
And yes, I have used the link inside the ” string but it’s not working when applying the code.
Thank you for your time.
Regards
DanielHi Daniel,
Which version of BuddyBlog you are using?As far as I see, Ravi’s code does work. Please note that it only changes the url in the sub menu nothing else.
Where you point that menu is up to you.
The link specified should be your own. To be hones, a better strategy would have been to redirect instead of changing this. Because that way, even editing would work.
Regards
BrajeshHi Brajesh,
Thank you for your help on this issue.
I have pasted exactly the whole code Ravi has provided into bp-custom.php but when I click on “Create New Post” then it says, Error 404 page not found.
What I try to do is that the user will be redirected to a specific page in order that he can create a new post, but he doesn’t get redirected with this provided code from Ravi.
Regards
DanielHi Daniel,
Have you replaced this line$subnav['new-post']['link'] = 'https://mywebsitelink.com';
with the actual url of your site?
Hi Brajesh,
Yes I did, I have put the proper link into the code from Ravi.
This is the whole code I have put in. But it has no effect in front end.
/** * Modify New Post tab link * * @param array $subnav Subnav item array. * * @return mixed */ function buddydev_modify_new_post_tab_link( $subnav ) { $subnav['new-post']['link'] = 'https://properlinktocreatenewpost'; // Replace URL with yours return $subnav; } add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );
Thank you for your help.
Regards
DanielHi Daniel,
Can you please check the version of BuddyBlog that you are using and let me know?Thank you
Brajesh
The topic ‘ [Resolved] Need to delete a textline in BuddyBlog plugin’ is closed to new replies.