dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Posted by Karen Dougherty 2 years 44 weeks ago

pic
 Karen Dougherty
mobiForge Newbie
Posts: 1
Joined: 2 years ago
[offline]

I recently changed themes and my widgets stopped showing up on mobile. I tried de-activing and then re-activating the mobile plug in and still - no widgets. I lost my goodle ads on mobile and the meta. Any suggestions?

Posted by James Pearce 2 years ago

pic
 James Pearce
Mobile Grandmaster
Posts: 148
Joined: 5 years ago
[offline]

When you say you changed themes, do you mean you changed the desktop one or the mobile one?

If the former, there might be an issue with the new theme declaring a different name for its sidebar panel. Obscure, but possible.

If the latter, which did you change it to? Only the Mobile Pack themes are aware of how to render the mobile selection of widgets. If you are using a mobile theme from somebody else, you might have to hack the relevant piece of code out of our themes to put into theirs.

Anyway, can I have a little more background to help? (Or the URL of your site so I can take a look)

Thanks

Posted by gilkman 2 years ago

pic
 gilkman
mobiForge Newbie
Posts: 1
Joined: 2 years ago
[offline]

I am having the same problem. I got widgets to show up on my iPhone with www.gilkeson.net However, I did the same install on www.type1tootsie.com and no widgets...

Great plugin, by the way!

Posted by James Pearce 2 years ago

pic
 James Pearce
Mobile Grandmaster
Posts: 148
Joined: 5 years ago
[offline]

Hi guys,

Widgets can be a little troublesome in general because some desktop themes declare their own uniquely 'named' sidebars. The mobile plugin can't guess what that name is - and, since it tries to displays widgets on the default, 'anonymous' sidebars, nothing shows.

There are two crude ways you can fix this. One is to alter the desktop theme to be nameless; the second is to get the mobile plugin to work with the particular named sidebar in the theme.

Make backups of the relevant files before fiddling too much :-)

1) Edit the desktop theme to have its main sidebar to be unnamed. In the desktop theme folder, you'll find functions.php, in which that theme designer will have declared the main sidebar. Remove the name from here. For example:

register_sidebar(array(
  'name' => 'A really swanky sidebar',
  'before_widget' => '<li id="%1$s" class="widget %2$s">',
  ...

becomes

register_sidebar(array(
  'before_widget' => '<li id="%1$s" class="widget %2$s">',
  ...

You will also need to find where the theme actually displays the sidebar (probably in sidebar.php, but not necessarily) and remove the name there. It might be something like:

  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('A really swanky sidebar') ) : ?>

which needs to become:

  if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

You will probably also have to re-attach your widgets to the 'new' unnamed sidebar in the WordPress admin pages.

--- OR ---

2) Edit the mobile theme to use the name in question. In the themes/mobile_pack_base folder, edit the functions_persist.php file at line 50, alter:

  register_sidebar(array(
    'before_widget' => '<li>',

to become

  register_sidebar(array(
    'name' => 'A really swanky sidebar',
    'before_widget' => '<li>',

and then in sidebar.php, at around line 33 or so:

  dynamic_sidebar();

becomes

  dynamic_sidebar('A really swanky sidebar');

Whichever way around you do it, you should now have a desktop theme and a mobile theme that both share the same unnamed (or named) sidebar.

Don't forget you made these changes if you update either the desktop theme or mobile plugin/theme in the future.

Does that work?

(A less crude and more complicated solution for *me* to implement is to get the mobile theme to be clever enough to figure this out in the first place)

I hope that helps.

James

Posted by ojohnson 2 years ago

pic
 ojohnson
mobiForge Newbie
Posts: 1
Joined: 2 years ago
[offline]

Hi James,
No it doesn't work! I tried option number 2 with no luck.
Some of the widgets work, for example, the Mobile Bar Code Widget. But when I try the regular WP Search widget it doesn't work. Is there anyway I can get this widget to work?

Thanks,
OJ
himnarioadventista.net