Skip to:
Content
Pages
Categories
Search
Top
Bottom

How To Remove “by” from Topics Widget


  • Thakksy
    Participant

    @thakksy

    Hi folks,

    I’m having some trouble trying to remove the “by” part in the bbpress latest topics widget. I’ve inspected the css and html and can’t figure it out. Any help would be great.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Robkk
    Moderator

    @robkk

    The “by” is printed in php, as displayed in this code here.

    https://github.com/ntwb/bbPress/blob/master/src/includes/common/widgets.php#L822

    There is a way to use CSS to hide the “by” though. It will look like the topic title has a little margin away from the topic authors name.

    Here is a custom CSS example.

    .widget_display_topics li {
      visibility: hidden;
    }
    
    .widget_display_topics li > * {
      visibility: visible;
    }

    There might be a way to use a plugin like Loco translate to just translate “by” to nothing also, but I have never tried that plugin before, and I am not 100% if that would even work. But it could be another possibly easy solution.


    Thakksy
    Participant

    @thakksy

    Thanks @robkk I added that css and it ended up removing the entire bbpress topic widget. I’ll have to keep thinking of way 🙁


    Robkk
    Moderator

    @robkk

    It should work as long as your using all the CSS code I used. You can try this instead if you want. It does away with the universal selector and the > because it wasn’t really needed, it includes text to know what this code is used for, and it I added !important for the heck of it.

    /*
    This removes the whole list item 
    for every recent topic in the widget,
    this includes the "by"
    */
    .widget_display_topics li {
      visibility: hidden !important;
    }
    
    /* 
    This will make every HTML tags content in the list item 
    for every recent topics in the widget to become visible,
    this does not include the "by",
    so the "by" stays hidden
    */
    .widget_display_topics li div,
    .widget_display_topics li span,
    .widget_display_topics li a {
      visibility: visible !important;
    }

    Thakksy
    Participant

    @thakksy

    Thanks so much the last CSS worked correctly. Appreciate your help in this matter 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar