Hi,
As I am using a separate Blog plugin, I would like to delete the following sentence and the link on buddyblog:
“You haven’t posted anything yet.” “New Post”
Could you please help me how I can hide this sentence and as well the link next to it saying “New Post”?
Thank you.
Kind regards,
DanielHi Daniel,
Please copy the wp-content/plugins/buddyblog/template/buddyblog/posts.php to yourtheme(or child theme)/buddyblog/posts.phpand you will note that line at the bottom. Please feel free to edit it.
That will work with future updates of BuddyBlog too.
Best regards
BrajeshHi Brajesh,
Thank you for your reply.
Apologies, I have changed my mind, I just would like to hide the “New Post” link next to the text “You haven’t posted anything yet.” as it makes more sense.
Could I use a CSS code to just hide the “New Post” link or how do I need to hide that?
Thank you.
Regards,
DanielHello Daniel,
You have to override the template as mentioned above and manually delete the code from that template. With CSS there is not proper selector available for “New post” link in the template if we do it with twenetyseventeen theme. It can doable with the following CSS code
div#item-body a[href$="buddyblog/edit/"] { display: none; }
But might affect any other place.
Thank You
RaviHi Ravi,
Thank you for your reply.
I would like to do the change on the file but that it is made in the child theme to prevent overwritings on buddyblog updates.
Did I understand you guys well that:
1. I just download the wp-content/plugins/buddyblog/template/buddyblog/posts.php file
2. then I add the code you have provided above at the end of the posts.php file
3. and then I store this new posts.php file in the main root of the child theme ?Thank you very much for clarification.
Kind regards,
DanielHi Daniel,
1. Putting the file is child theme is fine.
2. You are right about all except, you will be removing the code not adding anything to it.3. Please avoid the suggestion from @ravisharma. Even though It will work, It will be an issue in future. You can do without it.
Regards
BrajeshHi Brajesh,
I have downloaded the posts.php file and I am trying to figure out which part of the code I need to remove, in order that the “New Post” Tab disappears:
here is the code which appears at the end of the posts.php file. Could you please tell me which text I will need to remove please as you have explained above?
Thank you.
<?php elseif ( bp_is_my_profile() && buddyblog_user_can_post( get_current_user_id() ) ): ?> <p> <?php _e( "You haven't posted anything yet.", 'buddyblog' );?> <a href="<?php echo buddyblog_get_new_url();?>"> <?php _e( 'New Post', 'buddyblog' );?></a></p> <?php endif; ?>
2. In order to apply the changes in the child theme, do I need just to create a new folder on the main root of the child theme and call it buddyblog and copy the posts.php inside and that’s it ?
Thank you.
Kind regards,
Daniel- This reply was modified 6 years, 6 months ago by Daniel.
Hi Daniel,
1.<?php elseif ( bp_is_my_profile() && buddyblog_user_can_post( get_current_user_id() ) ): ?> <p> <?php _e( "You haven't posted anything yet.", 'buddyblog' );?> </p> <?php endif; ?>
2. Yes.
Regards
Brajesh
The topic ‘ [Resolved] Need to delete a textline in BuddyBlog plugin’ is closed to new replies.