WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar customization (19 posts)

  1. jozue06
    Member
    Posted 6 years ago #

    hello

    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?

    Thanks

  2. Ivovic
    Member
    Posted 6 years ago #

    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.

  3. joetaxpayer
    Member
    Posted 6 years ago #

    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.
    Joe

  4. Ivovic
    Member
    Posted 6 years ago #

    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.

  5. jozue06
    Member
    Posted 6 years ago #

    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.

  6. joetaxpayer
    Member
    Posted 6 years ago #

    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.
    Joe

  7. joetaxpayer
    Member
    Posted 6 years ago #

    Nevermind, found the code. No need at all for the widgets.
    Joe

  8. jozue06
    Member
    Posted 6 years ago #

    bump

  9. laplix
    Member
    Posted 6 years ago #

    @ivovic hi

    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.
    Louis

  10. converting2wp
    Member
    Posted 6 years ago #

    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.
    See http://codex.wordpress.org/Design_Widgets_SubPanel
    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).

  11. jozue06
    Member
    Posted 6 years ago #

    Thanks converting2wp

    i'll be trying this out soon!

  12. Ivovic
    Member
    Posted 6 years ago #

    @laplix

    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.

  13. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I disagree! (fist thrust firmly in the air)

    Everybody should be using widgets.

    Everybody.

    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?

  14. Ivovic
    Member
    Posted 6 years ago #

    the phrase is 'build it and they will come' not 'come over and wait while I build it' :)

  15. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    This is open source. You can help build it too. :P

    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.

  16. Ivovic
    Member
    Posted 6 years ago #

    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.

  17. Ivovic
    Member
    Posted 6 years ago #

    What I like most about wordpress is that there's no custom templating language. Its all just php.

    What makes wordpress so flexible is that you can VERY EASILY just intercept what's going on and do some cool stuff with it. The further you hide that by increasing the required code by a factor of ten, the less flexible you make it.

    A dramatic increase in widgetization will decrease the value of wordpress as a CMS to power users, unless a widgetless option remains available. I would find that quite a loss.

  18. converting2wp
    Member
    Posted 6 years ago #

    Moderator Otto42 says:

    Future versions of WordPress might not even support the manual sidebar.php approach anymore. You never know, after all.

    And what happens to footer.php, header.php, and the other places where folks might want to drop dynamic code? I tried widgets. They wouldn't do what I wanted. I reverted to editing sidebar.php -- using Template Tags which seems to me to be the right level of abstraction. (Or at least it's a programming paradigm that seems natural to me, someone who's been programming for 40 years but rarely builds anything --even a plugin or a widget -- from scratch.)

    If the quote from Otto42 is a serious prediction, I'd suggest that this discussion be moved to a new thread.

  19. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    I tried widgets. They wouldn't do what I wanted.

    Oh, no, they would have done what you wanted. You just didn't know how to make them do it.

    There is nothing that you can do with manual editing that you cannot also do with widgets.

    I reverted to editing sidebar.php -- using Template Tags which seems to me to be the right level of abstraction. (Or at least it's a programming paradigm that seems natural to me, someone who's been programming for 40 years...

    Kinda my point. Most users of WordPress are not programmers. Nor should they have to be, IMO.

    If the quote from Otto42 is a serious prediction, I'd suggest that this discussion be moved to a new thread.

    I wouldn't call it particularly serious. Just an idea floating around in the mishmash of ideas I call a mind. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic