WordPress.org

Ready to get started?Download WordPress

Forums

Device Theme Switcher
[resolved] Widget Locations (7 posts)

  1. hifidesign
    Member
    Posted 1 year ago #

    I'm really enjoying Device Theme Switcher and its simplicity -- much more svelte and preferable to WordPress Mobile Pack. One thing I've found that DTS lacks, however, is the saving of widgets locations specific to the mobile themes (unless I'm missing something). It's definitely not working for me using the Simple Mobile theme at least.

    http://wordpress.org/extend/plugins/device-theme-switcher/

  2. James Mehorter
    Member
    Plugin Author

    Posted 1 year ago #

    Hi hifidesign,

    Thanks for your kind words and interest in DTS!

    Per your question.. this is an inherent issue in WordPress itself; that you can not assign widgets to an inactive theme's sidebars. For instance, if your desktop theme is activated, you can not add a widget to the handheld or tablet theme.

    To circumvent this, I recommend creating an identical sidebar in each theme, and adding both DTS widgets to that new sidebar. This way, both themes can see and use the same sidebar. Doing this would require having the identical register_sidebar() function in both themes, and likewise, having the same dynamic_sidebar() in both as well, to display the sidebar.

    If you're using a pre-made theme this may prove difficult, so you may find it easier to simply display those links with the DTS functions instead of the DTS widgets. You can see an example of this here: http://wordpress.org/extend/plugins/device-theme-switcher/faq/

    Let me know if this makes sense, or if you would like a further explanation / assistance.

    James

  3. FrictionNL
    Member
    Posted 1 year ago #

    Hi,

    I am liking the DTS plugin as well, exactly what I needed.
    But I am also having an issue with the widgets; For the mobile and tablet site I want to use different widgets than on my 'normal site', and I have setup specific widgets for each version. But only the widgets of the active theme in wordpress are shown so all 3 versions have the same widgets. The active theme overwrites my widget settings for the tablet and mobile, is there a trick to prevent this? Or did I do something wrong?

    Jp

  4. hifidesign
    Member
    Posted 1 year ago #

    Thanks for the reply, James. I mostly get what you were saying.

    This explanation perplexes me, though:

    If you're using a pre-made theme this may prove difficult, so you may find it easier to simply display those links with the DTS functions instead of the DTS widgets.

    As an aside, at one point WordPress Mobile Pack had a feature where you actually could specify the widgets that you wanted to pull from the desktop theme into the mobile. At present, that feature is broken and WMP looks like it's at abandonware stage.

    Thanks for providing the community with a simple, free, and extremely useful plugin! Please don't give up on your baby anytime soon.

  5. gergokuzd
    Member
    Posted 1 year ago #

    Hi James, I am with FrictionNL. How can we set device switcher or wordpress to show widgets for the inactive theme? My problem is that the inactive theme doesnt show any of the widgets I have setup in the active theme???!

  6. James Mehorter
    Member
    Plugin Author

    Posted 1 year ago #

    FrictionNL and hifidesign, please accept my apologies for not responding sooner!! For some reason WP hasn't been notifying me of new posts to this support forum.

    hifidesign: The statement about using a pre-made theme being difficult was in regards to possibly being a pain to create new sidebars. It may be easier to use the template tags like <?php if (class_exists('Device_Theme_Switcher')) : Device_Theme_Switcher::generate_link_to_full_website(); endif; ?> in a php widget or pasting them right into the theme. Of course you would need to make the same change every time you update the theme.

    The easiest solution for all of you, if you're making the theme, is to create the same sidebar in both themes, so you would have the same register_sidebar() in both the active/computer and mobile themes. BUT you don't have to display the sidebar in both themes - you would only display it in the mobile theme with dynamic_sidebar(). This way the sidebar is present in the active/desktop theme and you're able to add widgets to it, and it's present in the mobile theme so the widgets can be displayed.

    Please let me know if you guys have any other questions about this approach! Thanks. - James

  7. redkite
    Member
    Posted 1 year ago #

    Hi James,

    I want to make sure I understand this part about widgets.

    So for my mobile theme, there will only be a couple of widgets in the footer sidebar. The default theme has a large number of widgets, but none of them overlap between the two themes (no widget appears in both themes).

    How do I deal with that - can I just hide the relevant default-theme sidebars in the mobile theme with a simple function in functions.php? Do I need to create a new sidebar for the footer that will only display in the mobile theme?

    I just don't want all my default theme widgets to disappear into the inactive box when a user switches themes...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.