ThemeShaper Forums » Thematic

[closed]

How to hide empty widgets in Sidebar?

(14 posts)
  • Started 9 years ago by puffmoike
  • Latest reply from rekopacz
  • This topic is resolved

Tags:

  1. puffmoike
    Member

    I have been using Widget Logic, and more recently Random Posts, to control which pages a widget appears on.

    My problem is that when the widget is not meant to appear, the outputted html still contains:

    <div id="primary" class="aside main-aside">
    <ul class="xoxo"> </ul>
    </div>

    Because I have hung some background images off the div and ul tags in my child theme's CSS I am left with a visible, but empty, widget on the page. (Sorry, I can't post a link because I can't risk my development work for my client showing up in Google).

    What's the best way to get around this?

    Posted 9 years ago #
  2. Hi puffmoike-

    This has been discussed over here.

    http://forums.themeshaper.com/topic/page-top-widget-and-widget-logic-display-issue

    -Gene

    Posted 9 years ago #
  3. puffmoike
    Member

    Cheers Gene. That's twice you've come to my rescue. [Hangs head for not finding thread when searching before posting.]

    Sounds like the functionality that you and Chris were discussing will be great when it gets integrated into Thematic proper.

    Posted 9 years ago #
  4. Hi,

    I contacted the authors of Widget Logic and Widget Context today.

    Chris

    Posted 9 years ago #
  5. Hi,

    I already got a first answer from Kaspars (Widget Context).

    Chris

    Posted 9 years ago #
  6. puffmoike
    Member

    Chris,

    Thanks for following this up.

    Most of this currently goes way over my head, but if you're contacting plugin authors you might also consider contacting Rob Marsh, the author of Random Posts and a family of related plugins.

    These appear to use a similar method of giving users control over which pages widgets appear on, as well as a host of other options. A quick glance at the download stats on the WP Plugin Directory pages suggest this family of plugins is much more popular than Widget Logic and Widget Context, at least within the general WP community.

    Michael

    Posted 9 years ago #
  7. Widget Context will be the first plugin without this problem and it'll work out of the box :)

    Chris

    Posted 9 years ago #
  8. puffmoike
    Member

    Excellent.

    Am I correct in assuming that you think the widget makers should be designing their widgets to output differently when there is nothing to output, and that the approach you and Gene have been discussing in other threads regarding altering Thematic is essentially a hack to overcome the inadequacies of the existing widget's code?

    Posted 9 years ago #
  9. @Chris
    -This is great news.

    @puffmoike-
    -I think the devs behind these plugins have done a fantastic job of providing broad functionality to a broad audience. The audience being the WordPress community. The advent of theme frameworks and theme parenting raises the level of complexity for these developers and adds an new facet to their user base. I'm glad to see any developer tackle the complexity introduced by theme frameworks but I'd never expect or demand it of them.

    -As for the other discussions, much of it involves the functionality that is developing in Thematic for the purpose of creating widget-areas that can be filtered, sorted, created, removed,renamed, conditionally displayed etc by child-theme developers. In this case it just happens that some of the functionality provided by these plugins is also provided by thematic. Personally, I prefer plugin independent solutions. Don't get me wrong there are plenty of plugins I won't do without. But in most cases, I would rather craft a very specific solution with a few lines of code instead of using a plugin that uses several php files, a javascript file or two and a bunch on inline styles, to provide a wide array of functionality, all of which I may not even need in the first place.

    -Gene

    Posted 9 years ago #
  10. .. and sometimes it's just magic :)

    When I started to work on an easier way to add additional widgetized areas, it took me only a couple of days to realize that I dislike my own code. So I rewrote the whole thing using an array for the configuration, suddenly realizing the whole range of different options 'caused by this code change. ;)

    Posted 9 years ago #
  11. Hi,

    the new version of Widget Context containing the fix is available. Just install it or upgrade it. The fix works out of the box.

    Sending a 'Thanks a lot for your help!' to Kaspars at http://konstruktors.com/.

    And it would be great, if you buy him a beer or so at http://konstruktors.com/blog/projects-services/ to say 'Thank you'.

    I already bought him a few six-packs. :)

    Chris

    Posted 9 years ago #
  12. Btw.: Kaspars told me that he also figured out a way to fix Widget Logic. He'll send the fix to the author once it is tested.

    Posted 9 years ago #
  13. rekopacz
    Member

    Well, the empty tags problem is still there with Widget Logic, even though this discussion seems to say it was fixed over one year ago. I am using the most recent ver of thematic and wordpress, and just downloaded Widget logic and I am getting the empty tags.

    Can someone point me to a solution? Do I need to filter or modify something via functions.php? Your advice would be appreciated, I am 90% towards a really cool site for a client and this is the last stepping stone, and its wobbling in the creek!

    related question, when somebody posts to a forum subject to which I have posted, will I get an email?

    Thx!

    Posted 8 years ago #
  14. rekopacz
    Member

    PS I have not been able to limit widget visibility on a local dev server with Widget Context at all using the URL feature. The above post also describes work on a local dev server using WAMP.

    Posted 8 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.