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

Change function in responsive theme

WordPress has a function called wp_is_mobile. It does very simple User Agent checking, which isn’t very reliable. There are a lot of user agents out there and they can easily be falsified. There is no guarantee that a browser representing itself as some user agent actually is that user agent. You can do more complicated … Read more

Benefits of storing uploads in an assets folder?

The only directory a theme or a plugin should write to is the uploads directory. That is the only directory with guaranteed write access (besides the server’s temporary directory). Anything else is wrong and might not work. There is no practical difference between both, except one: the upload directory may be on another (sub) domain … Read more

How can I serve different images depending on screen size with wordpress

add_image_size does change the actual size of the image file. What I hava tried: function odevice_image_sizes() { add_image_size( ‘iphone-size’, 300, 100, true );//OF course the dimensions are not correct… add_image_size( ‘tablet-size’, 600, 300, true ); } function show_odevice_at_img_select($sizes) { $sizes[‘iphone-size’] = __( ‘Image size for iphone’ ); $sizes[‘tablet-size’] = __( ‘image size for tablet’ ); … Read more

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