video header in desktop view, image header in mobile view

First, add video header support on your theme. add_theme_support( ‘custom-header’, array( ‘video’ => true ) ); Next, add the_custom_header_markup(); on Header area where you want to show the image / video header. Finally, style your video header with some css like this. .wp-custom-header iframe, .wp-custom-header img, .wp-custom-header video { display: block; height: auto; width: 100%; … Read more

force download a file in template_redirect hook

The solution is in fact very simple. Just use the action admin_post_(action)… add_action( ‘admin_post_export_page’, ‘export_page’ ); function export_page() { // any code you want } than you can make custom links admin_url( ‘admin-post.php?action=export_page&id=’ . $post->ID ); Thanks Milo for giving the solution.

How to prevent a style sheet to affect a header.php or footer.php?

You can define specific stylesheets for specific PHP files. If you are using a Child Theme, use the functions.php of the Child. You should use something like: function my_custom_css() { wp_register_style( ‘stylesheet_name’, get_stylesheet_directory_uri() . ‘/stylesheet.css’ ); } add_action( ‘init’, ‘my_custom_css’ ); function my_custom_css_enqueue() { // only enqueue on product-services page slug if ( is_page( ‘my-page’ … Read more

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