Trying to customize the sidebar on my blog. i started with the default theme of kubrick, and have since customized the header, footer, background, but cant seem to get the sidebar to change.
been looking around the site all day, and cant seem to find a simple explanation.
what file do i need to change to customize it, and what lines of code?
if you’re editing sidebar.php, then you’re in the right place… but, you won’t see much of it, unless you stop using widgets.
here’s the deal…
those who don’t know what “editing files” means, move to the left side of the room. those who know what <?php ?> does, move to the right side of the room.
everyone on the left should be using widgets, everyone on the right should NOT be using widgets.
Ivovic – Just checking – for a given sidebar, I need to choose between widgets, and my own sidebar stuff. Right? Can’t mix the use of both?
To the OP – see sidebar.php and decide if you are comfortable editing this stuff to add/remove what you wish. You don’t say if it’s on your server, but I suggest editing but saving the clean copy, as a mistake will make a mess or get an error message.
well, with a little hacking you should be able to modify your theme to allow widgets first, then your own stuff – or the other way around, but you won’t be able to intermingle them.
the thing is, if you know enough to make that change to your theme, there’s no reason I can think of to use widgets at all.
i’m ok with editing it in php and css but i dont know if i have any widgets. i dont want widgets. i simply want to put links in the sidebar so i can navigate back to the other pages of the website i’m trying to integrate the blog into.
I did not mean to hijack this thread. I understand your response. The only widget I cannot find code to write myself is the Tag Cloud. I’ll keep looking, or pass on it.
Nevermind, found the code. No need at all for the widgets.
Care to explain why widgets are bad? I’m totally new to WordPress but know a lot (enough?) PHP to read and write.
I did the BAD THING! Downloaded WordPress, installed it and started to make my theme right away.
So the question is: Why are widgets a BAD THING?
Lots of thanks for your time.
Okay, back to the original question.
If using Widgets –
Go to Design Widgets SubPanel and select the ones you want. They’ll show up in the right side of that page and you can then drag and drop to put them in the right order. Some have configurable options to further customize them. Save the changes and your sidebar will be modified.
Note that there is a “Text” widget that will allow you to place HTML in the sidebar that may work for the links back to your main site.
If you don’t want to use Widgets (and I agree that if you know PHP, they may be more trouble than they are worth):
Be sure you’ve deleted all the Widgets in the SubPanel above.
Then in the Design > Theme Editor SubPanel (or wherever else you found the header.php, footer.php, and other files) find the sidebar.php.
You’ll find that it has the code that will generate the sidebar if you are NOT using widgets. Add your own navigation HTML there (maybe replacing the line
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
that WordPress would use to link to other WordPress Pages.
Much of the code in the default theme’s sidebar uses Template Tags which are documented at http://codex.wordpress.org/Template_Tags (if you *do* want to use WordPress constructs in the sidebar instead of just linking back to your main site).
So the question is: Why are widgets a BAD THING?
I didn’t say they were a bad thing, I just said they were for people who didn’t know how to edit their files.
widgets are much easier to use, but are much less flexible… so if you enjoy customization, wean yourself off widgets.
I disagree! (fist thrust firmly in the air)
Everybody should be using widgets.
Widgets are the wave of the future. Future versions of WordPress might not even support the manual sidebar.php approach anymore. You never know, after all.
Also, widgets have distinct advantages. If they’re done correctly, then widgets maintain the same content across different themes. They add that layer of separation between content and presentation that the sidebars lacked up until now. Widgets add far more flexibility than manually editing code has, because they’re easier to work with. Want to move a sidebar piece around? Drag and drop is much nicer than cutting and pasting arbitrary code around.
Now, there are still some things widgets are not good at, admittedly. But those need to be fixed by introducing more widgets or adding on to existing ones. Not by eschewing them for *manual code editing*. What kind of serious CMS expects you to manually tinker with the code, anyway?
the phrase is ‘build it and they will come’ not ‘come over and wait while I build it’ 🙂
This is open source. You can help build it too. 😛
It also means that nothing gets built if nobody uses it. Widgets work perfect for me, I have nothing I need to add to them. Other people might have different needs, so they need to learn to contribute and make improvements as well.
So saying that people who know PHP should not use widgets is silly. We need more people who know PHP using widgets, and improving them.
I’m building my sidebar, I’ll come help you blow up your garage with widgets when I’m done 😉
(I didn’t say php, I said edit files… obviously everyone who knows php should be working on whatever you want them to :P)
I don’t actually like the widget concept very much in the first place. If I came over, I’d work on the anti-widget.
- The topic ‘Sidebar customization’ is closed to new replies.