How to edit widget without changing core files?
-
Hi, I’m trying to edit the avatar size and get rid of by author in the recent topics widget without messing with core files. I’m new to messing with widgets. I’ve tried a few different methods and nothing has worked.
// Maybe get the topic author if ( 'on' == $settings['show_user'] ) : $author_link = bbp_get_topic_author_link( array( 'post_id' => $topic_id, 'type' => 'both', 'size' => 14 ) ); endif; ?>
In wp-content>plugins>bbpress>includes>common>widgets.php
If my question is too much just please point me in the direction for what I need to learn about myself.
Thank you 🙂
-
Wow 3 months and no answer to something like this…. I am wondering the same thing, is there really no way to edit the widgets without editing the core?
Well, I’ll just throw the obvious out – copy the current widget and create a new one from it.
All widgets (even if you use the same more then once) can be individually edited how they look.
From colors, headers, font type/size/color/shadow, widget background color/image,
you name it, it can be done, WITHOUT editing any core files.How? Just use css.
For the ladies question, assuming she uses the bbPress “Recent Topics” widget, just add the following to the bbPress main ccs file (bbpress/templates/default/css/bbpress.css):.widget_display_topics .bbp-author-avatar { display: none ! important; }
This will remove the little avatar and leave it with:
topic title by posters nameYou can find any widgets “css class or id (id can be used if the same widget is used more then once)” by viewing the source code of your page or using FireBug (firefox or chrome browsers, just get rid of IE all together)
You should also follow this, to avoid any updates from changing your edits:
You should have all your customizations as per this document
https://codex.bbpress.org/theme-compatibility/OOPS, miss read what the lady wanted. Here is the css for larger avatar and name removed.
It will show: topic title by avatar-image
You can not remove the word “by” with css, it comes from a core file..widget_display_topics .avatar { width: 30px ! important; height: 30px ! important; } .widget_display_topics .bbp-author-name { display: none ! important; }
Just change the 30px size to anything you want.
Keep in mind that the core file has created already an avatar thumbnail of 14×14 and this will just resize that image, therefore will become somewhat unclear.@ronthai: CSS is NOT always the answer. I need to add a class to the bbPress login widget’s avatar.
- You must be logged in to reply to this topic.