BuddyDev

Search

[Resolved] Need to delete a textline in BuddyBlog plugin

  • Participant
    Level: Master
    Posts: 497
    Daniel on #14951

    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,
    Daniel

    • This topic was modified 6 years, 6 months ago by Daniel.
    • This topic was modified 6 years, 6 months ago by Daniel.
  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14965

    Hi Daniel,
    Please copy the wp-content/plugins/buddyblog/template/buddyblog/posts.php to yourtheme(or child theme)/buddyblog/posts.php

    and 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
    Brajesh

  • Participant
    Level: Master
    Posts: 497
    Daniel on #14976

    Hi 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,
    Daniel

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #14986

    Hello 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
    Ravi

  • Participant
    Level: Master
    Posts: 497
    Daniel on #14987

    Hi 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,
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #14989

    Hi 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
    Brajesh

  • Participant
    Level: Master
    Posts: 497
    Daniel on #15000

    Hi Brajesh,

    Thanks for the input, I will try it out tomorrow morning and will let you guys know how it went.

    Thank you.

    Regards,
    Daniel

  • Participant
    Level: Master
    Posts: 497
    Daniel on #15062

    Hi 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.
  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #15091

    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

  • Participant
    Level: Master
    Posts: 497
    Daniel on #15128
    This reply has been marked as private.

The topic ‘ [Resolved] Need to delete a textline in BuddyBlog plugin’ is closed to new replies.

This topic is: resolved