Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find HTML rendered by <?php wp_head(); ?> in WordPress?

Tags:

I have done a lot of search on it, most of the people are saying

wp_head() is located in wp-includes/general-template.php

wp_head is in default-filter.php in wp-includes

But I want to know where the html/php file placed in file directory that is rendered by wp_head(), so I can edit that file. Thanks

like image 474
Mujassir Nasir Avatar asked Jun 27 '14 14:06

Mujassir Nasir


People also ask

Where can I find Wp_head in WordPress?

wp_head() is located in wp-includes/general-template.

What is <? php Wp_head?

php wp_head(); ?> is a hook that allows WordPress, themes, and plugins to add HTML wherever it is placed. WordPress uses it to output all the scripts and stylesheets from themes and plugins between the <head></head> tags of your theme.

How do you edit a WordPress head?

To find the file and edit it yourself go to wp-content > themes > your-theme-name > header. php. You can then open it in a code editor and make any changes you need to.

What is Wp_head and Wp_footer in WordPress?

Action hooks are placeholders where code is dynamically added to a theme. What this means is that the wp_head and wp_footer functions act as placeholders for plugins to insert code to the <head> and <footer> of the theme respectively.


2 Answers

The wp_head() function simply calls all functions hooked to the wp_head action. Various functions will be hooked to this action, they may reside in the WordPress core, or perhaps in plugins you may be using, or even in your theme's functions.php file.

To my knowledge, there isn't a specific wp_head template 'file' that you can edit.

Ref:

  • http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head
  • http://codex.wordpress.org/Function_Reference/wp_head
like image 166
henrywright Avatar answered Sep 19 '22 19:09

henrywright


Following https://codex.wordpress.org/Function_Reference/wp_head

wp_head() is located in wp-includes/general-template.php.

If you want edit something, execute a Control+MAJ+F (Find in folder) in wp-includes and it gives you the file where the specific content should be edited.

like image 37
Thorene Avatar answered Sep 17 '22 19:09

Thorene