Time for action—installing the mobble plugin
The plugin is installed and activated just like any other. Perform the following steps:
1. On the Install Plugins screen, search for mobble. This gives a list of just one plugin—the one with that name, as shown in the following screenshot:
2. Install and activate the plugin.
What just happened?
We installed and activated the mobble plugin. We now have access to a number of conditional statements to detect and work with different devices. The simplest, and the one we will be using here, is is_mobile()
.
Note
For a full list of the conditional functions available with the mobble plugin and how it works, go to http://wordpress.org/extend/plugins/mobble/.
Now that we have the plugin, we need to add some PHP code to our theme files to display the right image at the right place.
The code we need to edit is within the Loop. Depending on how our theme is set up, this will either be in a theme file of its own, called loop.php
, or within another theme file (or more...