• Resolved KayMac

    (@kaymac)


    The site I’m working on is https://www.quiltpuppy.com/dogblog , using 2.8.1. (Yes, I know, it’s dogblogging but will you help me anyway? ??

    The theme seems to have hard-coded sidebar items. My understanding is that if I put a widget in using admin, these are supposed to go away. However, they do not go away. The widgets I add appear in addition to them.

    Compounding the problem: I have the disappearing widget phenomenon. Appearance>widgets… dragging and dropping widgets to the sidebar, then there’s nothing in the sidebar area. Then sometimes there is. And sometimes they’re not the ones I put there most recently. Usually they do appear on the site though. Except…

    Compounding the problem… the Links (also Linkslist) widget won’t appear on the site no matter how may times I drag it to the sidebar in admin.

    This is in sidebar.php:

    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar() ); ?>

    And this is in functions.php:

    <?php

    if ( function_exists(‘register_sidebar’) )
    register_sidebar(array(
    ‘name’ => ‘Left Sidebar’,
    ‘before_widget’ => ‘<div class=”menuheader”></div><div class=”menucontent”>’, // Removes

    • ‘after_widget’ => ‘</div><div class=”menufooter”></div>’, // Removes
    • ‘before_title’ => ‘<h5>’,
      ‘after_title’ => ‘</h5>’,

      Any help?

      Thank you so much!

Viewing 13 replies - 1 through 13 (of 13 total)
  • It does sound as if you have some hardcoded link or template tags in your sidebar as well as a widget-ready area. You’d need to edit your sidebar to either remove the unwanted code or move the <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ); ?> line so that it appears immediately after the first <ul> tag.

    The second problem sounds like a plugin or theme issue. Try deactivating all plugins and/or switching to the default theme.

    Thread Starter KayMac

    (@kaymac)

    esmi, thank you for chiming in. Moving the line did not help (at least if I did it right). That made an admin widget appear on top of a coded widget. So I commented out the coded widgets in sidebar.php and that did make them disappear.

    Second problem… switching to default theme and then back again seems like it may make the widgets stick in admin. Will need to play with this some more.

    Only problem left… links/linklist are being stubborn and will not show up on site. Not even in default theme. Why might this be?

    Thread Starter KayMac

    (@kaymac)

    A little progress… if I switch to default theme and *then* add the Links widget, Links show up on the site.

    Something in my theme is suppressing the links widget. Where would I look to address this?

    Many thanks

    Difficult to say. You could try functions.php but it may be difficult to spot.

    Thread Starter KayMac

    (@kaymac)

    Well, here it is!

    (Edit: removed by mod.. Please post large sections of code on a pastebin site then post the links back here.. large code posts in these forums messes them up)

    Comment something out? Replace something? Any thoughts? Most grateful for the help.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Post the entire contents of your sidebar and functions files on https://wordpress.pastebin.com , then post the resulting links back here. This will let people see what you’re facing and tell you how to fix it.

    Thread Starter KayMac

    (@kaymac)

    Thanks Otto, will do. I didn’t know about pastebin. I posted the above before I read yours. K.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Also, looking at that code you posted (before I had to remove it), if you comment this out, then it’ll disable the theme’s links replacement widget:

    if ( function_exists('register_sidebar_widget') )
        register_sidebar_widget(__('Links'), 'widget_techdesigns01_links');
    Thread Starter KayMac

    (@kaymac)

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Instead of using <!– and –> to comment sections out, use these: <?php /* ?> and <?php */ ?>

    Slightly faster site that way. Also, it prevents the PHP code from running, which you need to disable things like the search and/or links modifications being made by the theme.

    Thread Starter KayMac

    (@kaymac)

    Thanks for hanging in there with me, total amateur that I am. (But liking the learning!) I did the above, and the built-in sidebar items are all suppressed. However, still, the Links or Linklist widget does not make links appear in the sidebar using this theme. I’ve done so much to tweak this theme with success, I feel like I’m aaaalmost there if I can just solve this one.

    Am having crazy thoughts of making a kludgy workaround by using the built-in links and replacing the graphic to make it look like the others. But then would have little control over order of items in the sidebar. Save me from this fate.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    In this: https://wordpress.pastebin.com/m6ab46d3b

    You have the search thing commented out, but not the links widget.

    Make sure you’re commenting out what I posted, not something else.

    This has all the three widgets modified by that theme disabled:
    https://wordpress.pastebin.com/m3fb3b368

    Thread Starter KayMac

    (@kaymac)

    Moderator sir, you are a rock star!

    I really had tried what you said before, but apparently did not do it correctly. I had then commented out the theme widgets in sidebar.php instead of in functions.php. I was flailing around the solution. Thank you so much for actually fixing the file for me. All is now well.

    Kay

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Unruly widgets’ is closed to new replies.