Using SRCSET with Images and Featured Images

Browsers which understand the srcset attribute will automatically choose the image which corresponds between the defined sizes and available space. Most of modern browsers support this, older browsers still found in the wild will gracefully fall back and simply use the image linked in the src attribute. There is no additional Javascript needed to activate, … Read more

detect screen width in functions

According to codex, wp_is_mobile(); is a boolean function that returns true if the user is visiting the website on a mobile device, so what you need is: if ( wp_is_mobile() ) { // Run this only for mobile visitors add_filter( ‘wp_nav_menu_items’, ‘B_function’, 10, 2 ); function B_function(/* add B */ ); } else { //If … Read more

Mobile issue – website isn’t properly detecting screen size [closed]

Your primary menu container is set to left: 5000px; witch stretches the width of the page. You can find this style directive in …themes/sunstone-bookkeeping/css/mobile.css on line 66. @media screen and (max-width: 600px) .nav-menu { position: absolute; left: 5000px; } One way to fix this is to add the following styles to the parent element: .menu-menu-1-container … Read more

Divi – How can we show background video on mobile

I figured out a “down and dirty” fix in the theme code. This will be overridden when you update the theme so you’ll have to do it again at that time. themes/Divi/includes/builder/scripts/frontend-builder-scripts.js Lines 1316 – 1330 if ( et_is_mobile_device ) { $( ‘.et_pb_section_video_bg’ ).each( function() { var $this_el = $(this); $this_el.closest( ‘.et_pb_preload’ ).removeClass( ‘et_pb_preload’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)