• I’m using Mistylook theme and sidebar widgets. I’m trying to edit the sidebar, but the code is all over the place. Some I can edit within the widget, some in sidebar.php., some in functions.php, some in widgets.php, etc. (I’m still confused by the fact that the site uses sidebar.php for the sidebar, but if you turn on widgets, that is ignored.)

    I added a sidebar block in the widget. I want to use it for all the credits (WP, Vanilla, Mistylook), but I can’t seem to do what I want within the widget and I can’t find the file that holds the info on the server. Any help?

    Also, need help adding links to the sidebar. HTML I can do, but php is still a huge struggle. Any hints appreciated.

Viewing 11 replies - 1 through 11 (of 11 total)
  • I’m still confused by the fact that the site uses sidebar.php for the sidebar, but if you turn on widgets, that is ignored.

    Actually, no it’s not. You *need* the sidebar.php file to display the wigdetized sidebar, just as much as you need it to display the regular one.

    The widget area starts with “if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar() ) : else :” Which says “if the dynamic sidebar exists, then display nothing but the dynamic sidebar…else display the sidebar you see below” – which is your default sidebar code when the plugin is shut off. If the plugin is on, and you edit the code below the stuff you see above, you won’t see the changes on your site (until you shut off the plugin).

    If you want to edit your sidebar widget code, you have to go into the widget.php file – scroll towards the bottom and start picking away after the “Default Widgets” area.

    Alternatively (and even better), you could just edit your stylesheet to display stuff as you like.

    Any links that you want to remain constant – even if the widgets are on or off, you need to add after the widget code ends in the sidebar.php file.

    Adding links to the sidebar stuff that’s already there – just go to your Blogroll area and add them. They’ll show up.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Or just use a better widget. The default ones are fine, but basic. Loads more widgets are available at https://widgets.wordpress.com

    Thread Starter AMSmith

    (@amsmith)

    I didn’t say that very well. I meant that the sidebar content was ignored in favor of the other info. Thanks for interpreting the Greek for me!

    I did check in the widgets.php file. When IN the widget, I added a sidebar area that I titled “Credits.” I can’t see that in the widgets.php file anywhere (or sidebar.php), so I don’t know where to go to edit it.

    Any ideas?

    Otto42, I guess I could try that route, but I’m already utterly confused!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Alright, widgets made simple:

    The general idea of widgets is to replace your sidebar content with the widgets.

    Sidebars generally consist of blocks of stuff with content in them. In widget terms, each of these blocks is a widget. You can arrange and rearrange these blocks on the widgets control panel (Presentation->Sidebar Widgets).

    So for any given block of sidebar, you’ll want a new widget. If the widgets you have don’t fit what you want, you either need a new widget which does fit, or you need to create a new widget/modify an existing one.

    Instead of editing sidebar.php for anything, you go to the widgets control panel and mess around with the particular widget you want to mess around with.

    To add new widgets (like those at https://widgets.wordpress.com ), you download that particular widget, upload it to the plugins, and activate it. It’s just a plugin like any other. Once you’ve activated it, the new widget will be available to you on the widgets control panel, and you can drag/drop it, configure it, whatever.

    In other words, to mess with the sidebar content, generally you’ll go to Presentation->Sidebar Widgets and mess with it there. Nowhere else (hopefully).

    Now, about your “Credits”. Probably you want to create a Text widget. So you’d go to the widgets control panel, drag a Text widget up to the sidebar, then click it’s configure button. You’ll name it “Credits” and then put in any HTML you like for it. Then you save. And voila, you have a Credits box in your sidebar.

    The idea of widgets is to eliminate the need to ever touch the PHP code for your sidebars. However, there’s not a widget for every occasion (yet), so sometimes you may need a custom one here or there. If you do need that, then we can help you either find one or tell you how to create one.

    Thread Starter AMSmith

    (@amsmith)

    Otto, thank you for the info, and thank you for not calling it “Widgets for Dummies,” even though it would have been appropriate. Your assistance is appreciated.

    I did use a text widget, but didn’t realize that I could just code HTML into the text. I thought I needed php. That’s fixed.

    In general, though, I still had a problem. For example, I wanted to change the content of the default Meta box. I can’t edit the content of the box from within the widget, I can only change the TITLE. So, I had to dig out the code.

    For my own sanity, do you know where the code resides for this new text sidebar that I created? It’s driving me mad…or something. ??

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Content that you put into widgets lives in the database.

    And instead of hacking the main widget code to modify the meta bar, I recommend using a text box to make your own links instead. This way, you won’t lose your changes if you upgrade the widgets plugin later.

    Thread Starter AMSmith

    (@amsmith)

    Great input. Thanks very much.

    Hi guys,
    This is a rather basic, amateur question (I’m new to WordPress). The text widgets on my sidebar are not saving. I’ve dragged them into the sidebar but when I try to customize/write stuff on them, they’re not saved. (I type the changes up then press “x” then “save changes”). Is there something I’m missing? Does it matter that I’m using the theme Fjords by Peterandrej? Thanks very much, guys! Appreciate any help. ?? Have a great week!

    Victoria

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Make sure that you’re using the correct version of the widgets code for your version of WordPress:
    https://automattic.com/code/widgets

    Thanks, Otto! ?? I’ll check it out. Have a great weekend!

    This information is soooo close to what I need. I’m having problems getting the widgets to recognize & use the styles, so I want to see how the widgets are set up and make sure my styles cover them.

    However, I don’t have “widgets.php” listed anywhere in my theme files. Is this somewhere else?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Sidebar code location?’ is closed to new replies.