storing wp_head in a variable?

This function doesn’t take any params, so there is no nice way of doing it. But of course you can do this PHP way using output buffering 😉 ob_start(); wp_head(); $var = ob_get_clean();

How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?

If we look at the file /wp-includes/default-filters.php we can find these two lines in there add_action( ‘wp_head’, ‘feed_links’, 2 ); add_action( ‘wp_head’, ‘feed_links_extra’, 3 ); so if we want to remove these actions, we can do it with these two lines in functions.php: remove_action(‘wp_head’,’feed_links’,2); remove_action(‘wp_head’,’feed_links_extra’,3); So the feed links will be removed from the <head> … Read more

Remove Genericons Helper CSS from twentyfourteen theme

First of all, you’re trying to deregister a stylesheet that doesn’t exist. Here is how the genericon stylesheet is enqueued in twenty fourteen wp_enqueue_style( ‘genericons’, get_template_directory_uri() . ‘/genericons/genericons.css’, array(), ‘3.0.2’ ); You are trying to dequeue the stylesheet file name. Here is the wp_enqueue_style() function wp_enqueue_style( $handle, $src, $deps, $ver, $media ); The important part … Read more

wp_head hook by page ID [closed]

If you want to use different meta tags for different pages I recommend you to use custom field values. If you prefer to do it with conditional functions, try this: add_action( ‘wp_head’,’carlos_head_meta_page’ ); function carlos_head_meta_page() { if ( is_page(‘4’) ) { $description = ‘tag1’; } else { $description = ‘tag2’; } ?> <meta name=”description” content=”<?php … Read more

Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?

If you look at the source code, you can see that wp_enqueue_style( ‘crayon’ ) is called in Crayon::enqueue_resources() which itself is called either from either Crayon::the_content() or Crayon::wp_head(). The code in Crayon::wp_head is: if (!CrayonGlobalSettings::val(CrayonSettings::EFFICIENT_ENQUEUE) || CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT)) { CrayonLog::debug(‘head: force enqueue’); // Efficient enqueuing disabled, always load despite enqueuing or not in the_post self::enqueue_resources(); } … Read more

Replace category titles

Well thank you for this question i did this after you posted this function category_title( $title ){ if( is_category(‘name1’) ){ $title=”name1 title”; }elseif( is_category(‘name2’) ){ $title=”name2 title”; } return $title; } add_filter( ‘get_the_archive_title’, ‘category_title’ ); Hope this helps

add action wp_head not working

Pull the add_action() outside of the function, and put the conditional inside the callback. Also, if you’re printing a script directly, use wp_print_scripts instead of wp_head. You also have a syntax error. function testingone(){ if( get_option( ‘MyOptionName’ ) ) { ?> <script>var Script = GoesHere; </script> <?php } } add_action( ‘wp_print_scripts’,’testingone’ );

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