Putting content into header.php without using wp_head

Removing wp_head will have some negative effects as it won’t allow you to use virtually 90% of the plugins on wordpress.org. Also some of that code you are seeing only shows up when you are logged in (unless your theme is specifically adding it). For example, the dashicons, open sans, and admin-bar stylesheets and inline … Read more

How to remove/hide action links cluttering under specific plugins’ names

You have the right approach. You will want to use the admin_enqueue_scripts hook: add_action( ‘admin_enqueue_scripts’, ‘wpse_239302_hide_action_links’ ); function wpse_239302_hide_action_links() { global $pagenow; if ( $pagenow == ‘plugins.php’ ) { ?> <style type=”text/css”> .visible .proupgrade, .visible .docs, .visible .forum, .visible .jetpack-home, .visible .support { display: none; } </style> <?php } }

Cannot load admin-ajax.php. No access-control allow origin*

There are filters for allowed_http_origins and add_allowed_origins. You can use them to set the proper Access-Control-Allow-Origin header in the response to your AJAX call. Add this to your theme’s functions.php file: add_filter(‘allowed_http_origins’, ‘add_allowed_origins’); function add_allowed_origins($origins) { $origins[] = ‘https://www.yourdomain.com’; return $origins; }

Headers already sent error with CSV export plugin

Move your download/output code into admin_init hook. This hook is called before anything is output. It should work. <?php /* Plugin Name: Your Site’s Functionality Plugin Description: All of the important functionality of your site belongs in this. Version: 0.1 License: GPL Author: Your Name Author URI: yoururl */ add_action(‘admin_menu’, ‘my_page_export_menu’); add_action(‘admin_init’,’wpse9876_download_csv’); function my_page_export_menu() { … Read more

Add code into on a per page/post basis

As you said per page/post basis, this would work for each post add_action(‘wp_head’, ‘add_link_in_head’); function add_link_in_head() { global $post; if(!empty($post)) { $alternate = get_post_meta($post->ID, ‘alternate’, true); $hreflang = get_post_meta($post->ID, ‘hreflang’, true); if(!empty($alternate) && !empty($hreflang)) { ?> <link rel=”alternate” href=”https://wordpress.stackexchange.com/questions/110260/<?php echo $alternate; ?>” hreflang=”<?php echo $hreflang; ?>” /> <?php } } } If there is no … Read more

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