+321 123 4567
info@test.com
  • Home
  • My Services
    • Web Design
    • Web Development
    • Technical Writing
  • Portfolio
  • My Thoughts
  • Free Tools
    • Photo Editor
    • Avatar Generator
    • Email Migration Tool
    • QR Code Generator
    • RSS to HTML Converter
    • IP Address Geolocation
    • Base64 Image Encoder
    • NATO Translator
    • All Tools
  • Contact
Home
Wordpress
How to Easily Add Widgets on MobilePress

How to Easily Add Widgets on MobilePress

Wale Adekile
July 16, 2014

With all the rave for responsive designs going on, some folks like me still prefer a dedicated mobile website and if you’re using WordPress, there a lots of plugins you can install to mobilize your website in a matter of minutes. MobilePress is one of such plugins and I’ve been using it for a couple of years now. MobilePress is very flexible and that’s one thing I love about it; you can create your own theme and make your mobile website appear just the way you want. Using shortcodes on the mobile template is also possible if you know your way around it.


One of the setbacks is that unlike responsive designs, you cannot use widgets on MobilePress. If you rely a lot on widgets for a good user experience, you can easily add them to MobilePress by following the simple steps in this guide.

Using Widgets on MobilePress

– Download and install amr shortcode any widget plugin

– Go to Appearance > Widgets. You should now see a new widget area named Widgets for Shortcodes

– Drag the widgets you wish to show on MobilePress here. You can drag as many widgets as you want but it’s good to keep it minimal.

– In this tutorial, were using two widgets as examples: WordPress popular Posts and Recent Comments. Of course, you can add any widget you want.


widgets on mobilepress

– Note the names of the widgets as shown above.

– Now login to cPanel file manager and go to where your MobilePress theme is located.

For default theme: …/public_html/wp-content/plugins/mobilepress/themes/default

For custom theme: ……/public_html/wp-content/mobilepress/themes/theme_name

– Locate footer.php and edit

– On the very first line, you should use this shortcode to display recent comments:

<div style="margin: 5px;">
<?php echo do_shortcode('[do_widget "recent comments" widget_classes=none title=true wrap=htmltag class=dcwidget]') ?>
</div>

-And to display WordPress Popular posts, use this:

<div style="margin: 5px;">
<?php echo do_shortcode('[do_widget "wordpress popular posts" widget_classes=none title=true wrap=htmltag class=dcwidget]') ?>
</div>

The letters in red denote the name of the widgets I asked you to note earlier in the tutorial. You can change this to whatever you want so far the widget is placed in Widgets for Shortcodes widget area on your WordPress dashboard.

– For further customization, you can add this in your CSS file to style the widget:

.dcwidget {
border: 1px solid #DDD;
padding: 10px;
border-radius: 5px;
margin: 5px;
}

Instead of using the widget name in the shortcode, you can use the widget ID as explained by the plugin author on this page.

In this case, the code to use should look like this:

<div style="margin: 5px;">
<?php echo do_shortcode('[do_widget "id=widget-id-here" widget_classes=none title=true wrap=htmltag class=dcwidget]') ?>
</div>

This is useful if the widget name won’t work and this happens in rare cases. It’s a great plugin that offers lots of possibility even if you’re just trying to display a widget on post pages or you’re trying to create a widgetized homepage for the full site.


Previous Post
Responsive Design vs Dedicated Mobile Site: Which is Better?
Next Post
iPhone 6: Rumors, Facts and Leaked Images
Wale Adekile
Husband to the world's most beautiful woman and father to two awesome kids. A nerd, obviously; also, a technical business analyst, a web designer who preaches the gospel of WordPress, and a writer. You can check out my published books on Amazon.
change domain name
Wordpress

How To Change Your WordPress Domain Name Without Losing Traffic

8 years ago
mailoptin
ReviewWordpress

MailOptin Review: A Complete EMail List Building Plugin For WordPress

7 years ago

Recent Articles

wahl rapic clip hair clipper
Wahl Rapid Clip Hair Clipper Review: DIY Made Easy
BenQ LaptopBar Review: Luxury or Necessity?
yunmai easepro unboxed
Yunmai EasePro Massage Gun Review
g20
Teendow G20 Robot Vacuum and Mop Review
bathroom
Dear Men, Spraying All Over the Toilet Seat is Disgusting and Irresponsible
winx mediatrans
How to Transfer Photos from iPhone to Computer Without iTunes
google workspace
How to Migrate Emails From Google Workspace/G Suite to cPanel
synology diskstation ds920+
Synology DiskStation DS920+ Review
playstation 4
Why I haven’t Upgraded to the PlayStation 5 Yet
pain
Started Watching Anime as an Adult? You’re Not Alone

All contents on this blog are copyright protected and cannot be reproduced on other websites without permission.

Copyright © 2022 – NerdieDad | Home | Contact | About | Privacy Policy