Happy New Year everyone! I'm in the middle of a theme overhaul using WPMU-Nelo and have a question...
How Can I get the Recent Global Posts Widget to appear in multiple sidebars?
Nelo provides a Home Top Right sidebar that only displays on the Custom Homepage. When I add the Recent Global Posts widget, it is removed from Available Widgets, so I can not also add it to the site-wide Sidebar. :-(
Any suggestions? Same question would also apply to the Recent Global Comments and Supporters widgets. Thanks!
Happy New Year everyone! I'm in the middle of a theme overhaul using WPMU-Nelo and have a question...
How Can I get the Recent Global Posts Widget to appear in multiple sidebars?
Nelo provides a Home Top Right sidebar that only displays on the Custom Homepage. When I add the Recent Global Posts widget, it is removed from Available Widgets, so I can not also add it to the site-wide Sidebar. :-(
Any suggestions? Same question would also apply to the Recent Global Comments and Supporters widgets. Thanks!
Thanks for the info. Is this something we might look forward to in future updates of these plugins? Or is their any way your typical hack like me, who has never coded a plugin, might be able to duplicate a widget without causing re-declare errors?
Ya just gotta love this community! Thanks, however...
The option to Show Title shows the title. Show Content shows the content. But Show Title and Content shows neither.
Anyone else care to help out by creating second widgets for:
widget-blogs.php (shows random/recent blogs)
widget-supporter.php (shows random/recent supporter blogs)
6593 pointsLike some sort of WPMU DEV GodExceptionally helpfulLifetime member
Keeper of the Dark Chocolate
—
3rd January 2011 (1 year ago)
#
So it does for the most part work, right? I didn;t get a chance to test it.
The option to Show Title shows the title. Show Content shows the content. But Show Title and Content shows neither.
You'll have to edit the widget and put in new data for those fields. Did you give that a try?
Basically what you do is go through and rename all of the function calls, option names and variables. In this case, I just added a _2 to everything. Open up the file and please make sure I didn;t miss anything.
I'll take a look at it later tonight to see if I missed something.
We used to have a method of doing multiple widgets with just one set of code. The text widgets are like that. Maybe one of us can edit the original for that.
You'll have to edit the widget and put in new data for those fields.
I'll give that a shot... My first attempt to duplicate the widget (before I posted here) by adding _2 everywhere threw some fun fatal errors. Guess I actually need to pay closer attention to what I'm doing!
Open up the file and please make sure I didn;t miss anything.
Sure enough, the option was missing where the widget gets printed... around line 168.
Should be:
if ( $options['recent-global-posts-display_2'] == 'title_content' ) {
Anyone else care to help out by creating second widgets for:
widget-blogs.php (shows random/recent blogs)
widget-supporter.php (shows random/recent supporter blogs)
Should anyone care to add either of these widgets to a second sidebar, try these attachments. They work for me, but are presented without warranty. ;-)
Rename with .php and drop into mu-plugins. Many thanks @drmike for the direction.
EDIT: Apparently I do not have permissions to upload zip files. Sorry!
10635 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Sales & Support Lead
—
5th January 2011 (1 year ago)
#
Hiya jcnjr,
Sounds cool. You could upload to another site (mediafire, etc) and provide a link to that. I'm sure other folks would be interested and we'd love you to share your work here ;D
Responses (14)
Lead Developer — 3rd January 2011 (1 year ago) #
They would need to be rewritten to use the newer widget API:
http://codex.wordpress.org/Widgets_API#Developing_Widgets_on_2.8.2B
Member — 3rd January 2011 (1 year ago) #
Thanks for the info. Is this something we might look forward to in future updates of these plugins? Or is their any way your typical hack like me, who has never coded a plugin, might be able to duplicate a widget without causing re-declare errors?
Keeper of the Dark Chocolate — 3rd January 2011 (1 year ago) #
Give me a sec....
Keeper of the Dark Chocolate — 3rd January 2011 (1 year ago) #
Please try this. Probably screwed up something but I think I got all the ones that I needed to.
Keeper of the Dark Chocolate — 3rd January 2011 (1 year ago) #
We still can;t upload text files? i thought this was fixed?
Keeper of the Dark Chocolate — 3rd January 2011 (1 year ago) #
Let's try a zip.
Member — 3rd January 2011 (1 year ago) #
Ya just gotta love this community! Thanks, however...
The option to Show Title shows the title. Show Content shows the content. But Show Title and Content shows neither.
Anyone else care to help out by creating second widgets for:
widget-blogs.php (shows random/recent blogs)
widget-supporter.php (shows random/recent supporter blogs)
Keeper of the Dark Chocolate — 3rd January 2011 (1 year ago) #
So it does for the most part work, right? I didn;t get a chance to test it.
You'll have to edit the widget and put in new data for those fields. Did you give that a try?
Basically what you do is go through and rename all of the function calls, option names and variables. In this case, I just added a _2 to everything. Open up the file and please make sure I didn;t miss anything.
I'll take a look at it later tonight to see if I missed something.
We used to have a method of doing multiple widgets with just one set of code. The text widgets are like that. Maybe one of us can edit the original for that.
Member — 4th January 2011 (1 year ago) #
I'll give that a shot... My first attempt to duplicate the widget (before I posted here) by adding _2 everywhere threw some fun fatal errors. Guess I actually need to pay closer attention to what I'm doing!
Thanks again!
Member — 4th January 2011 (1 year ago) #
Sure enough, the option was missing where the widget gets printed... around line 168.
Should be:
if ( $options['recent-global-posts-display_2'] == 'title_content' ) {
Thanks again!
Keeper of the Dark Chocolate — 4th January 2011 (1 year ago) #
Not a problem. If I only missed one of those, I did pretty good....
Member — 4th January 2011 (1 year ago) #
Should anyone care to add either of these widgets to a second sidebar, try these attachments. They work for me, but are presented without warranty. ;-)
Rename with .php and drop into mu-plugins. Many thanks @drmike for the direction.
EDIT: Apparently I do not have permissions to upload zip files. Sorry!
Sales & Support Lead — 5th January 2011 (1 year ago) #
Hiya jcnjr,
Sounds cool. You could upload to another site (mediafire, etc) and provide a link to that. I'm sure other folks would be interested and we'd love you to share your work here ;D
Thanks!
Member — 13th May 2011 (1 year ago) #
UPDATE: Looks like Recent Global Posts Widget v. 2.1 has been re-written, allowing multiple widget location use. Hooray! No more hacking every update.
Thanks again for all the hard work. WPMU Dev Rocks!
Become a member