How to get a single hook from wp_head()?

wp_head is an essential part of the theme, and there is too many things that might fall apart if it is not there. Hunting and fixing them one by one might be time consuming and the worthiness of the all operation questionable. In you snippet for example you want to remove things that make no … Read more

Custom script file enqueue has “?ver=4.5.1” when loading and doesn’t update

I agree with @Mark Kaplun – what you’re describing is an odd behavior though. Try this markup to override the $ver param. wp_enqueue_script( ‘script’, get_template_directory_uri() . ‘/js/script.js’, array ( ‘jquery’ ), null, true); https://developer.wordpress.org/themes/basics/including-css-javascript/ Alternatively, to work around the version cache try this markup which will generate a unique version with each page load. wp_enqueue_script( … Read more

ACF custom field in [closed]

In the header.php template, you cannot access the $post variable. So you will have to map it using $wp_query, as mentioned on ACF forum here. Try this: <?php global $wp_query; $post = $wp_query->post; $background = get_field(‘background’, $post->ID); ?> <style> .site-header { background: url(<?php echo $background; ?>) no-repeat center; background-size: cover; } </style>

Inject HTML meta tag inside wordpress tag using add_shortcode

First thing, wp_head action hook does not accept any argument at all, so am not sure whether the $url variable will be passed. To run the short code properly, you have to call do_shortcode(): add_action( ‘wp_head’, ‘refresh_page’ ); function refresh_page() { echo do_shortcode( “[refresh url=”http://stackoverflow.com”]” ); } add_shortcode( ‘refresh’, ‘refresh_shortcode’ ); function refresh_shortcode( $atts ) … Read more

removing wordpress generated code from the head section?

1) Normally not (that’s the translation mechanism offered for javscript strings), but you can probably de-register that l10n script. But be warned that some plugins and the site might not work as intended any longer. 2) Yes, by uninstalling the contact form 7 plugin. 3) Yes, by removing the disqus plugin. 4) If disabling the … Read more

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