Getting extra image links in code with wp_get_attachment_image
Getting extra image links in code with wp_get_attachment_image
Getting extra image links in code with wp_get_attachment_image
I guess that you can set the class for the paragraph and set it’s display to none only on mobile view. Such as, @media screen and (max-width:479px){ .nameofclasswhichtheparagraphhas {display:none;} } And add a button below it but set it’s display to none for Laptop users. Such as, @media screen and (max-width:768px){ .theclassofthebuton {display:none;} } and … Read more
Responsive images with srcset
It seems I forgot one crucial aspect: to edit the CSS of the img element. I set my img to: img { height: auto; max-width: 100%; vertical-align: middle; } That fixed the issue with regards to the images not being responsive.
This is not the best practice, it seems you should have an image for desktop and another one for mobile in order to fit well the screen. However, you can set where to focus using the background-position CSS Property. .imgBackground { background-image: url(‘image’); background-repeat: no-repeat; background-attachment: fixed; background-position: center bottom; } Check this life example.
WordPress Toggle Menu has stopped working
It’s a little bit of guessing, but… I’m pretty sure it’s just a CSS problem. The real order of your menu items is P1, P2, P3, and so on. And thus this is the order on mobile devices. On desktop, the order is changed, because there is float: right assigned to menu items, so they … Read more
$img->setAttribute(‘class’, ‘img-fluid’); This sets the class field to a new value. Simply change this line to $classes = $img->getAttribute(‘class’); $img->setAttribute(‘class’, $classes . ‘ img-fluid’);
Responsive Images – Defining
Can you see the changes in an incognito window on mobile? If so, then its most likely a mobile cache issue and a common way to fix that is by adding a version number to your css file i.e. wp_enqueue_style( ‘my-main-styles’, get_stylesheet_directory_uri() . ‘/style’ . $suffix . ‘.css’, array(), $version_number_here ); If breaking the cache … Read more