WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Tabbed Widgets] How to: Add text widget ONLY on tabbed widget (2 posts)

  1. Herbelizer
    Member
    Posted 5 years ago #

    Please correct me if some of my assumptions are (hopefully!) wrong.

    In combination with Exec-PHP, I am using lots of self-coded Text-Widgets. As far as I know, text widgets are completely deleted when I remove them from a sidebar, so you can't create them and save them for later purposes.

    Tabbed-Widget only "allows" existing widgets (What a phrase!), so I have to activate my self-designed text widget to add it to a tabbed-widget.

    So my self-designed widget is inevitably shown on two places. If I create a text-widget (=> activate it!), embed it to tabbed-widget and then remove it from the stand-alone position, it is also removed from the tabbed-widget bundle.

    Any help how to solve that would be appreciated!

  2. jeremyduffy
    Member
    Posted 5 years ago #

    Herbelizer, when I create a widget that I don't want to see on every page, I just use a div inside to give it an id then hide it with javascript for the pages it doesn't need to be on. If the exact same widget is showing up in two places on your page, then perhaps this idea won't help, but here's an example of how it works for me:

    in my widget:
    <div id=search_tags_area>
    (the stuff for the widget)
    </div>

    Then depending which page I'm on:

    <script>
    document.getElementById('search_tags_area').style.display = 'none';
    </script>

    To see it in action, check out http://www.jordans-town.com . When you go to the main page, there's only one search box. But when you click the Jsearch button (the one that says "Advanced Search"), the page you go to will trigger the other boxes to show where you can pick multiple tags and categories. Since I don't need those extra search boxes on any other page, I hide them.

Topic Closed

This topic has been closed to new replies.

About this Topic