Display posts from a different website on Genesis Responsive Slider
Display posts from a different website on Genesis Responsive Slider
Display posts from a different website on Genesis Responsive Slider
How to create ‘Local’ filters for WordPress srcset sizes in template parts?
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
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
If you were to use mediaqueries, you’d have to selectively dis- and enable DOM elements to which you have applied different images. Rather than that, I’d recommend conditionally applying different images to the same element, i.e. the <body> and keeping the condition inside the JS. wp_localize_script is capable of passing several parameters to the script. … Read more
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
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
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
The reason your generated size have larger size than the original image, is how the compression works. If you for example upload a low quality image that is 50kb is size, but your WordPress has JPG quality set to 100, then the thumbnails will size larger than the original image, since WordPress is not compressing … Read more
I’ve implemented a working solution for now, which is to input everything as a ‘flat’ no column post, this way the ‘flow’ of the content when the client is entering is exactly how it would be on mobile. On Desktop, I apply width:50% and masonry plugin to all direct child elements of the post-body container. … Read more