$content_width for responsive UI

When that variable was added to themes, was the July 2008. First time someone start talk about responsive design was the May 2010, two years later. Nowadays, that variable have lost is important (if ever it had one). Codex itself recommend to set the max width in css, like .size-auto, .size-full, .size-large, .size-medium, .size-thumbnail { … Read more

Responsive background images added inline

If you use Adaptive Images plugin for WordPress, you would just make one inline css for all viewport widths using the biggest image and then it does all the work on the server. You do nothing to your markup but in the Adaptive Images plugin settings you enter your breakpoints, so it will serve small … Read more

How can I make new .css file in child theme override styles in child theme’s style.css

You can enqueue your own stylesheet by adding this to your child theme’s functions.php file: function wpa_custom_css(){ wp_enqueue_style( ‘wpa_custom’, get_stylesheet_directory_uri() . ‘/responsive.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpa_custom_css’, 999 ); This will load the file responsive.css located in your child theme directory. The priority is set very low (999) so it is more likely to appear … Read more

Run shortcode at certain resolution

Ok, let’s clarify the concept. You don’t want download the content for mobile device, and you want to rely on screen resolution. You know that php (wordpress) run on server, screen resolution is a completely client-side matter. So the flow will be: user send a request to your site your site page load on client … Read more

Change theme based on window size

Your code actually works for me and it is changing the theme according to the current width. But I think you should need some tweaking something like below: For your JavaScript: var $ = jQuery; $(document).ready(function() { var windowWidth = $(window).width(); var windowHeight = $(window).height(); $.ajax( { type: “POST”, url: “http://example.com/wp-admin/admin-ajax.php”, // Must use absolute … Read more