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

Headers already sent on custom plugin (Export function)

You are probably executing your process_bulk_action function in template where some html and headers are already sent. You have to use handle_bulk_actions-edit-post hook to execute your code before any content is sent. This might look something like that: function wpse_287406_register_export_option($bulk_actions) { $bulk_actions[‘export_csv’] = __( ‘Export to CSV’); return $bulk_actions; } add_filter( ‘bulk_actions-edit-post’, ‘wpse_287406_register_export_option’ ); function … Read more

How to include different html tags in the header for different pages?

Just assign something to a variable and output that if(is_page(14) or is_page(16)) { $class_name=”bannerExp”; } if(is_page(18) or is_page(52) or is_page(22) or is_page(20)) { $class_name=”bannerD”; $somevariable=”test”; } if(is_page(27)) {$class_name=”bannerJ”;} if(is_page(25)) {$class_name=”bannerS”;} if(is_page(2)) {$class_name=”bannerH”;} <div class=”<?php echo($class_name);?>”> <?php (if $somevariable != ”) { echo $somevariable;} ?> That being said, this is a horrible way of doing things … Read more

Modify wp headers on specific page

from How can I change HTTP headers only to posts of a specific category from a plugin: add_action( ‘template_redirect’, ‘update_header_cache’ ); function update_header_cache() { if( is_single( 1234) ) { header(‘Cache-Control: no-store, no-cache, must-revalidate, max-age=0’); header(‘Pragma: no-cache’); header(‘Expires: Thu, 01 Dec 1990 16:00:00 GMT’); } }

Insert Code into Header Only on Blog Posts

Yes. In your functions.php file, add something like the following: function my_post_header_function() { if( is_single() ) { // Your Code Goes Here } } add_action( ‘wp_head’, ‘my_post_header_function’ ); What this will do is execute this when wp_head() is fired. It will see if you’re on a single post (NOTE: This will not work on pages … Read more

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