Making footer widgets responsive

Set the width of the div to 100% and remove the float for the media query used for smaller screens like this: @media screen and (max-with 600px){ .widget-area{ float: none; width: 100%; } } And for the desktop view: @media screen and (min-with 600px){ .widget-area{ float: left; width: 25%; } } BTW, this is just … Read more

Removing height and width from images with a caption

Here is another possibility, it alters the image markup when you select an image to add to your content in the editor add_filter( ‘image_send_to_editor’, ‘remove_img_attribute’, 10, 8 ); function remove_img_attribute( $html, $id, $caption, $title, $align, $url, $size, $alt ) { $imagetpl=”<figure> <a href=”https://wordpress.stackexchange.com/questions/129666/%s” title=”https://wordpress.stackexchange.com/questions/129666/%s”><img src=”https://wordpress.stackexchange.com/questions/129666/%s” alt=”https://wordpress.stackexchange.com/questions/129666/%s” class=”img-responsive %s” /></a> %s </figure>”; $figcaption = (!empty($caption)) ? … Read more

How to set cookies to switch style sheets when a link is clicked and set it till another particular link is clicked?

You can use init action to set cookie, and other init action to read it. However due its a cookie… you will need also to check GET variable. add_action(‘init’, ‘is_it_mobile_or_desktop’, 1); function is_it_mobile_or_desktop(){ if (isset($_GET[‘site’]) && in_array($_GET[‘site’], array(‘mobile’, ‘desktop’)) ) { setcookie( ‘site’, $_GET[‘site’], time() – YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); } } add_action(‘init’, ‘who_am_i’, 2); … Read more

Fuzzy Images in WordPress 4.4

The new responsive images feature takes some tweaking to make it work optimally. The standard settings work only for the most basic of themes. Read up on responsive images, specifically the srcset and sizes attributes. Manipulate the srcset and sizes values through the new wp_calculate_image_srcset and wp_calculate_image_sizes filters. There’s also a max_srcset_image_width filter that allows … Read more

Responsive Video Max-width

So, apparently, I needed to read a little bit more before I posted my question. After I posted the question, I ran across: https://moodle.org/mod/forum/discuss.php?d=258650, which is what I incorporated into the code I was using. I modified my function to look like: function video_embed( $html ) { return ‘<div class=”video-container”><div class=”video-wrap”>’ . $html . ‘</div></div>’; … Read more