Uses do_action() Calls 'wp_head' hook.

learn more… | top users | synonyms

0
votes
1answer
19 views

Output dynamic_sidebar_params in wp_head

I have created a custom widget with a color picker field. Currently there are two ways to output the color picker value for this widget: Inline style. Using the dynamic_sidebar_params filter. With ...
0
votes
1answer
775 views

Edit title-tag in wp_head with yoast seo

I want to manipulate the html-title tag, so <title> these not the content of the title-tag! I use child-themes and it's inevitable, because the template have to be easy to update. So I have to ...
0
votes
2answers
942 views

Set title of page using custom page template

Most of the related questions are still unanswered or have very little information. I have a custom theme for my website and use WordPress SEO for titles. All the article pages work fine, except for ...
0
votes
1answer
26 views

Cannot retieve the_content() and the_author() - both returning empty strings

I am creating the following code to display open graph meta data in the header of my single.php page add_action('wp_head', 'mycode_add_og_meta_tags', 5); function mycode_add_og_meta_tags () { ?> ...
3
votes
1answer
201 views

use add_action('wp_head') in a widget for generating dynamic CSS styles

I have been working on a 'Custom Pop Links' widget for use in a theme which is ready for distribution. User can change the color of a link using a color picker inside widget. Untill now, I used inline ...
4
votes
2answers
46 views

Display custom_background outside wp_head()

My theme is a very small one page theme which really doesn't need all the scripts, so I've created a few options to remove wp_head() and wp_footer() so the user can choose if they want to enable or ...
1
vote
1answer
37 views

Change Page's <title> Tag Using functions.php File

In my child theme's functions.php file, I'm trying to change a page's title tag: function custom_title() { return "Page Title"; } add_filter( 'wp_head', 'custom_title', 9999 ); The code above ...
0
votes
1answer
3k views

Echo a div to header.php from functions.php

Within the section of header.php I have a div structure <div id="header"> <div id="masthead"> <div id="branding"> ... I want to add a div within "branding" - I can do this ...
0
votes
1answer
32 views

How to hook into <head></head> container

I want to add my own <meta /> tag inside the <head></head> container on every page or post within the loop(). Is that possible? What hook(s) should I use for that?
1
vote
2answers
38 views

Is there a way to read or list wp_head() contents?

I am working on a CSS and JS compiler and need to find a way to list the contents of wp_head() I am trying to get a list of all CSS/JS files and inline CSS on any give page. Hooking on the wp_head ...
0
votes
2answers
23 views

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

I'm loading a custom script file using an enqueue and here's the output: <script type='text/javascript' src='.../wp-content/themes/enfold-child/js/custom_script.js?ver=4.5.1'></script> ...
0
votes
2answers
62 views

How to get a single hook from wp_head()?

I am working on a custom post type and I don't want it to get all the clutter from wp_head(). However, I do want to show a specific hook, for example the YoastSEO meta tags. How do I call a specific ...
0
votes
2answers
426 views

How do I add a logo to my website?

I would like to know how to do add a logo to my website, before the site title. <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>...
0
votes
1answer
26 views

How to check widget-cpt meta and display its custom css in the head?

When dealing with a widget that is a custom post type, is there a way to detect when that widget is displayed, then check its post meta for any custom css and enqueue it in the head of the site? ...
1
vote
2answers
5k views

add_action and wp_head not display content in head section

I have a big problem. In a Wordpress page I've a function that generate og meta tags. I want to "append" that generated meta in the head section. So, I write this code: add_action('wp_head', '...
0
votes
1answer
606 views

Why won't the action hook wp_head accept parameters?

I'm working on a plugin that adds scripting to the head using add_action('wp_head',..); I have to pass a variable to the function to get my desired result. To test this I'm simple "echoing" out ...
1
vote
1answer
180 views

Putting content into header.php without using wp_head

I am building a plugin. I have to output certain stuff in the header.php file of the theme depending on if/else I will write. However I am not at that point yet. I just learned in order to push the ...
3
votes
2answers
3k views

Two title tags in my header

I'm building a child theme and it currently has a very simple <head> section in header.php: <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport"...
2
votes
1answer
265 views

Remove specific CSS and JS from the head

I'm trying to remove some specific lines from the WP_HEAD. Now my header looks following way: <link rel='stylesheet' id='bootstrap-css' href='/themes/wp-e/css/bootstrap.css?ver=4.2.2' type='text/...
8
votes
3answers
264 views

Any advantage of using wp_scripts and is_IE when enqueuing scripts

I read on the WP docs, which pointed to this gist that the correct way to enqueue styles for IE is by using the $wp_styles. I'm guessing that this would be true then for scripts as well. Take these ...
1
vote
2answers
384 views

Deregister CSS style file from WP footer

When user is logged in WP add in its footer this CSS: <link rel='stylesheet' id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans....' type='text/css' media='all' /> That ...
0
votes
3answers
148 views

How to control initial wp_head() output?

I followed the common advise to use wp_head() in header.php and wp_enqueue_scripts() instead of hard linking css and js files in header.php. However, I realized that wp_head() outputs lots of stuff I'...
0
votes
0answers
88 views

How to output wp_enqueue_style() in HTML head instead of footer

I added some actions to wp_enqueue_scripts to load my custom css and js files in the header section by using wp_head(); right before the closing </head> tag. function mytheme_scripts(){ // ...
-2
votes
3answers
2k views

Why does wp_enqueue_script ignore my 'wp_head' hook?

I would like css_head_scripts and js_head_scripts to be appended to wp-head but Wordpress completely ignores it? Am I missing something? function css_head_scripts() { wp_enqueue_style( '...
0
votes
1answer
28 views

Grab ID from post from plugin and use it to create an object

I want to create an object and set ID for this object like $p = new Product(87); I have this code within a plugin and I want to grab the ID of the custom post being showed: function getPostId(){ ...
0
votes
0answers
26 views

How to tell where <title> tag is being pulled from

I'm working on a site, http://vibrantnation.com, and the meta info is jacked. I've looked in .header.php of both the child and parent theme, and it looks OK. I've checked plugins, like Yoasts' SEO ...
1
vote
1answer
85 views

Remove WordPress scripts

I am working on a custom page template in my theme and I want to remove all other styles and scripts which are loaded, like default theme style, jQuery & other scripts. I want to remove all for ...
0
votes
1answer
25 views

custom COOKIE on custom page

i have problem with create function for set cookie dynamically. when i try in custom page i have of course header is set and i tried something like this: in custompage.php: myfunction($cookiename,$...
1
vote
3answers
1k views

Indenting (tabbing) WP_head

Right now all the stuff that gets included in wp_head are left justified all the way in the code view. Whereas all my other code that is around the wp_head is indented (tabbed) two times. Is it ...
2
votes
1answer
1k views

How to remove pingback from head?

I know this question has been asked and answered 1000 times. However, I've never truly found a solution that removes pingback link tag from "wp_head". While there are several ways to block xml-rcp/...
0
votes
0answers
133 views

How to add rel=“next” & rel=“prev” in <head> dynamically?

I need to add link rel in the <head> section of each page if my current page url is http://xxxx.com/yyy/by-size.html/1/ then i need to add following link rel in head section <link rel="next" ...
1
vote
2answers
179 views

action hook wp_head higher priority as all other plugins/hooks

I work a bit with the wordpress API and I want to try to include a <meta>-tag into my head area of my website. This is my code (works everything fine!): class dmd_noindex_options_page{ ...
11
votes
2answers
12k views

How to Link External jQuery/Javascript files with WordPress

So I'm using Starkers to base my next WP theme on and I've run into a small issue, I was including my own version of jQuery in the header.php file but when inspecting my site using Firebug I noticed ...
2
votes
2answers
4k views

wp_head() not inserting the default stylesheet style.css

I have a custom theme with just a name in its style.css. I've activated it in admin which shows it just fine. In the index.php just <?php wp_head(); ?> and it doesn't output the line that is ...
0
votes
6answers
8k views

Add code into <head> on a per page/post basis

Is there plugin (or an easyish way) to add code to the <head> section on a per page/post basis? I have a multilingual website and I need to implement the rel="alternate" hreflang markup, so ...
0
votes
0answers
45 views

Put dynamic Javascript in header after doing operations

I want to write a plugin that enables a function to be put in my theme in various places. Then I would like to collect the parameters called and generate a Javascript and put it into my site <head&...
0
votes
4answers
324 views

ACF custom field in <head> [closed]

I've created an image field using Image URL via the ACF plugin. This field appears across my pages. This field enables admin to change the background image for a selected class. Here's the code I ...
0
votes
2answers
362 views

using wp_head in body tag for css style

I am trying to add css code into head tag. the css style is from shortcodes. title text from shortcode and title color / font size.. etc. This is an example. <html> <head> <?php ...
0
votes
4answers
576 views

Function to echo (or display?) wordpress tags in the head section

I can't figure this out but I'm trying to echo the post Tags of the post in the <head> section. This code resides in the <head> section of the site. Basically I want the post tags to ...
0
votes
2answers
136 views

add_action to wp_head is added, but not called

I'm using the CiviCRM plugin for WordPress, and in the plugin's main file, civicrm.php, it calls add_action() to add a function to wp_head() in order to merge CiviCRM's header with my theme's header: ...
4
votes
1answer
379 views

wp_head() gives me some weird CSS

I was trying to enqueue my stylesheets but it didn't work. Turns out I had forgotten to include wp_head() inside my <head> tag. So I did and then my stylesheets where loading fine. The problem ...
0
votes
1answer
101 views

How to style injected code in header section?

Trying to add custom code to header section <head>..</head>of the blog by adding this code to child-theme functions.php // Add scripts to wp_head() function child_theme_head_script() { ...
0
votes
0answers
15 views

Using WP Head to hook into a specific part of the header?

This is my first plugin. I'm trying to add a tagline underneath the logo. I'm using this code in the plugin: add_action('wp_head', 'tagline'); function tagline() { //Close PHP Tags ?> ...
0
votes
1answer
1k views

Add javascript to wp_head with call to plugin options?

I am trying to write a plugin in wordpress and have been doing it in stages, I understand how to add javascript to the wp_head however adding multiple function calls to the plugins options is ...
0
votes
0answers
39 views

Where to put wp_head() when using switch_to_blog()

Where should the call to wp_head() be in my case. I'm using switch_to_blog() in order to keep one consistent header with its own widgets and menus across all multisites. If I call wp_head() in ...
0
votes
2answers
74 views

Best use adding user generated JS/CSS to a theme with a plugin

I want to know the best use of adding custom JS/CSS to a theme. I have built a small plugin which has a section to allow users to add CSS/JS to their theme. Now I am trying to figure out is which is ...
0
votes
1answer
272 views

Change title in head on Archive page

I'm having problems with figuring out how I can change the title on my archives pages. I now have a title like this: <title>Jobs Archive - The Company</title> But I would like to have a ...
0
votes
0answers
8 views

Hooking into action that fires in wp_head from widget on front end [duplicate]

I have a custom action hook for which the do_action() is executed in a function that hooks into the wp_head action. I would like to run add_action() for that custom action hook from the front-end ...
5
votes
6answers
4k views

How to add stylesheets only to pages with specific shortcode?

I'm running a function on pages where the shortcode [make-me-a-map] is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the ...
0
votes
2answers
182 views

Remove tags from wordpress head

I don't know when or why but this tags are inserted on my wordpress head automatically and they are adding style that disturb my layout: <meta name="generator" content="WordPress 4.2.2"> <...