Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Blogging Forum


You are currently viewing our Blogging Forum as a guest. Please register to participate.
Login



Reply
Multiple Sidebars and Changing the Blogroll's Name in WordPress
Old 04-15-2008, 06:42 PM Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
I have two unrelated (I think) questions about Word Press. I am wondering if it is possible to:
1 - Have two different sidebars, one that appears on the index page and another that appears on the single post page.
2 - Change the name of the Blogroll

Thanks!
zephyrcat is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-15-2008, 08:39 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Feydakin's Avatar
Webmaster Talker

Posts: 541
Name: Steve
Trades: 0
1. Yes.. Name one Sidebar1 and the other Sidebar2 then in the index page call Sidebar1 and in the single page cal Sidebar2

2. Yes.. Go in to Manage -> Categories in your admin panel and edit the category and change the name to something else..
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
That gives back.
Feydakin is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 09:59 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
Thank you. I got the Blogroll renamed and created a new sidebar. One more problem, though. When I go into the second sidebar, I cannot add some widgets such as the Blogroll one, the search one, the archives one, and some others.

Any idea why?

Thanks!
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 10:18 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Feydakin's Avatar
Webmaster Talker

Posts: 541
Name: Steve
Trades: 0
You probably didn't copy the top part of the code from Sidebar1 that loads the widgets..

Make sure the sidebars have pretty much the same code..
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
That gives back.
Feydakin is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 11:01 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
I just duplicated the code for the first sidebar so it should be the same.
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 11:51 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Feydakin's Avatar
Webmaster Talker

Posts: 541
Name: Steve
Trades: 0
Gotta change the sidebar number in the code..

Code:
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>

and

<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
That gives back.
Feydakin is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 05:52 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
Hmmm... the line in my file looks slightly different:
Code:
<?php     /* Widgetized sidebar, if you have the plugin installed. */
                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
I changed it to
Code:
<?php     /* Widgetized sidebar, if you have the plugin installed. */
                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?>
for sidebar.php and
Code:
<?php     /* Widgetized sidebar, if you have the plugin installed. */
                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) : ?>
for sidebar2.php, but that did not help, so I changed it back.
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-16-2008, 07:11 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Feydakin's Avatar
Webmaster Talker

Posts: 541
Name: Steve
Trades: 0
Looks like an old template code for an old version of WP to me.. If you are running 2.5 run the code I gave you.. It's what I run..
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
That gives back.
Feydakin is offline
Reply With Quote
View Public Profile
 
Old 04-17-2008, 07:15 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
I am running 2.5 having upgraded just a little while ago. I used the automatic update plugin if that matters...
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-17-2008, 08:24 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
vangogh's Avatar
Post Impressionist

Posts: 10,689
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
The code you had (specifying the different sidebars) is right, but there's one more step. Since your theme was already widgetized you should have a file called function.php in your theme.

By default it registers one dynamic sidebar. You need to tell it you now have 2 sidebars.

You'll see:

if ( function_exists('register_sidebar') )

at the top of functions.php. I think all you need to do is change it to:

if ( function_exists('register_sidebar(2)') )

and then use the same code you tried above.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 04-17-2008, 10:17 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
I had some code like that in there already, but the original code was slightly different. It looked like this:
Code:
<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));
so I just added the new code to the end so now it looks like this:
Code:
<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));


if ( function_exists('register_sidebar') )
register_sidebar(2);
Still, it does not let me add some widgets.
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-18-2008, 06:09 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
vangogh's Avatar
Post Impressionist

Posts: 10,689
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
My bad about the code above. What you were trying to do was closer to being right than what I posted.

I think the issue might be due to the array and what you did above needs to be done a little differently.

What you might need to do is something more like:

PHP Code:
if (function_exists("register_sidebar")) {
  
register_sidebar(Array("name" => "sidebar1"));
  
register_sidebar(Array("name" => "sidebar2"));

I think you might need to name both sidebars too. You don't have to call them sidebar 1 and 2 either. You should be able to name them anything you want.

Here are a couple of posts that hopefully help

Wordpress 2 Widget sidebars is a short post which is mostly the code I posted above.

WordPress Widgets is a quick tutorial on widgets. The links for themes and the API are probably the most relevant.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 04-19-2008, 09:44 AM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
Thanks for the links. The second one seems very useful, but it basically just confirmed what I had already guessed. I am now using code from the examples on the second site, but I still have the same problem. (I did try the code you suggested, but it had the same result as everything else.) Here is the current code I am using:
functions.php
Code:
register_sidebars(2, array('name'=>'Sidebar %d'));
sidebar.php
Code:
<?php     /* Widgetized sidebar, if you have the plugin installed. */
                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar 1") ) : ?>
sidebar2.php
Code:
<?php     /* Widgetized sidebar, if you have the plugin installed. */
                    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Sidebar 2") ) : ?>
I did notice one thing which might be important. (I might have already mentioned it, actually.) If I remove one of the widgets that I cannot add to sidebar 2 from sidebar 1, I am then able to add it to sidebar 2.

Thanks!
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-19-2008, 07:14 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
vangogh's Avatar
Post Impressionist

Posts: 10,689
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Is the idea then that you can't add the same widget to both sidebars? I think that's a very different problem. Sorry if I misunderstood.

I'm not sure why you'd want to add the same widget to two sidebars in the first place, but I'd guess the problem is it can't exist in both places at once. You probably need to make a second copy of the widget and give it a different name in order to add it to both. To the system it would be two different widgets even if they end up with the same functionality.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 04-19-2008, 11:09 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
Yes, that seems to be the problem. Anyway, you helped me get a better idea of how the code really works.

It sounds like two copies should work, but how do I make another copy?

Thanks!
zephyrcat is offline
Reply With Quote
View Public Profile
 
Old 04-21-2008, 06:23 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
vangogh's Avatar
Post Impressionist

Posts: 10,689
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
You would need to find the file or files used to create the widget you want to copy and then obviously make a copy of them with a new name.

I'm not sure where the files for the blogroll and other things you mentioned at the top are located, but if it's a widget you added later it should be in the plugins folder.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 04-23-2008, 07:07 PM Re: Multiple Sidebars and Changing the Blogroll's Name in WordPress
Skilled Talker

Posts: 71
Trades: 0
It is a built-in widget. I cannot find the file where it is. Anyone know where the default widgets are used?
zephyrcat is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Multiple Sidebars and Changing the Blogroll's Name in WordPress
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.49023 seconds with 12 queries