The wp-head tag has no wiki summary.
8
votes
2answers
3k 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 ...
8
votes
3answers
441 views
WordPress Code Flow
I was interested in checking out how the WordPress code flow works... When I googled it, ( probably with the wrong keywrods), all I ended up was this;
...
6
votes
8answers
12k views
What does l10n.js do in WordPress 3.1? And how do I remove it?
I just installed WP 3.1 Beta 2 on my test server. I noticed that it ships with a new l10n.js file that gets automatically inserted into the header.
I did a bit of digging and it has something to do ...
5
votes
7answers
3k views
Why is wp_head() creating a top margin at the top of my theme header?
I am creating a custom theme, and elements behave as they should but when I place the <?php wp_head() ?> tag I get a top margin, at the top of my theme header.
When I remove the <?php ...
5
votes
1answer
260 views
Multi-page posts do not get indexed by Google due to canonical URLs
I've just noticed that on my paginated posts, only the main page gets indexed in Google. The paginated posts "post-title/2" and "post-title/3" for example, do not get indexed.
On closer inspection, ...
3
votes
3answers
131 views
How can I reduce the amount of files loaded/included per plugin?
I have a Wordpress site that uses several plugins, namely 8. Most of these plugins include a lot of their own JS and CSS files, some even include so much as 3 separate CSS files. One can imagine that ...
2
votes
1answer
651 views
when should an action be added to init and when should it be added to wp_head
How do you know when to add your action to init or wp_head. In particular with regards to scripts and styles, but also any other action.
2
votes
1answer
743 views
How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
My plugin uses wp_enqueue_style() and wp_enqueue_script() to load resources, but I have kept in mind not to degrade the performance for the user and only load these when the current set of posts ...
1
vote
3answers
524 views
How can I remove the site URL from enqueued scripts and styles?
I'm dealing with an SSL issue and I would like to strip the domain from all scripts and styles being output via wp_enqueue_scripts. This would result in all scripts and styles being displayed with a ...
1
vote
1answer
517 views
force enqueue script to be first in order of prominence
I have a few scripts which are being enqueued,
the problem is that I want to force the order of prominece to which these scripts are loaded. There is one in particular which is loaded from a plugin ...
1
vote
1answer
158 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 ...
1
vote
3answers
596 views
How do I force wp_enqueue_scripts to load at the END of <head>?
I am loading scripts via wp_enqueue_scripts in my child theme.
The only problem is that my style.css script get loaded BEFORE plugin scripts, yet I need to override the css in the plugins with my ...
1
vote
1answer
62 views
How do I test my localhost WordPress project with VirtualBoxVM?
I'm working on a WordPress project set up with MAMP on localhost. I try testing the site on internet explorer with VirtualBoxVM by browsing to my local ip.
My problem is, wp_head() outputs absolute ...
1
vote
2answers
189 views
Passing a variable via wp_head and then calling it on the page
As my question suggests I'm having difficulty creating a variable in the header, via functions.php and wp_head, and then calling that variable further down the page.
For example, in functions.php
...
1
vote
2answers
83 views
CSS from textarea in options page to frontend what to do
I have a textarea for small css enhancements on the plugins page i output them directly to the head. My Question is how to sanitize the CSS
i have validation function registered for the options with ...
1
vote
2answers
253 views
wp_head() not including styles and javascripts after a template redirect
I am using the template_redirect action to redirect a user to a custom template which has no header, sidebar or footer (the intent is for it to be in an iframe as a dialog box). After I done the ...
1
vote
1answer
174 views
Remove adjacent_posts_rel_link under 3.2?
I'm trying to remove the adjacent_posts_rel_link links under WP3.2, i.e. remove these from wp_head:
<link rel='prev' title='blah blah' href='http://...' />
<link rel='next' title='blah blah' ...
0
votes
1answer
77 views
Would there be anything stopping me from removing both wp_head and wp_footer?
Some plugins rely on either wp_head or wp_footer or both to introduce their own stylesheets and JavaScript. Those scripts take time to load and slow down my website. Therefore, I would like manually ...
0
votes
2answers
51 views
Display Something in the Header After All Styles are Loaded
I'd like to include a functionality in a theme that will overwrite styles from previously included CSS files. For this purpose, I need to be able to display a <style> in the header after ALL ...
0
votes
1answer
57 views
Can't find where to modify <html> attrbitutes
I am trying to create a simple function that adds or edits data in the <html>. Basically, before the server response is sent, I want to find where this piece of html is written at the top level ...
0
votes
1answer
253 views
Using auth_redirect returns cannot modify header information
I'm hooking auth_redirect to wp_head, but it's returning cannot modify header information. Do I have to hook it to a different action? Something that loads before wp_head? I tried hooking it to ...
0
votes
2answers
305 views
Remove swfobject.js in wp_head()
I have gotten rid of the wlwmanifest_link and jquery, since I load it from a compressed version and at the footer, but I can't find a way to get rid of the swfobject.js.
This is the code I used to ...
0
votes
1answer
100 views
Why does WP load so many files in the head of source code? How do I optimize it?
I have noticed that wordpress loads a bunch of files into the head of a site. This looks really sloppy and discloses vital information about the file structure of a website.
Depending how many ...
0
votes
3answers
228 views
append stylesheet via shortcode
Wondering how I can add a stylesheet to wp_head section via shortcode, since shortcodes are parsed after wp_head, I've hearing about output buffering but I Am not sure.
Any idea?
0
votes
3answers
3k views
wp_head() remove redundant scripts?
hey guys,
quick question. I'm using jquery for my current project (the latest release). A few plugins I'm using are using jquery as well and they are inserted through wp_head(). Since I want my ...
0
votes
1answer
38 views
wp_head() - list hooked actions with priorities?
I'd like to add something to wp_head() but I'm aiming precise location (like after style.css but before rtl.css and before my other custom script). I'm wondering if it's possible to list everything ...
0
votes
2answers
80 views
How can I modify what is being output in wp_head, whether by a theme or Wordpress in general?
I've been working on performance of my site using YSLOW, and noticed that Wordpress it outputting things in my document head that I know I don't need.
For example, I'm already calling jQuery 1.9 from ...
0
votes
1answer
249 views
How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?
When using w3.org's validation tool Unicorn I get the following error/warning:
URI: http://energyshop.se/hem/feed/
This feed does not validate.
After looking into my source its there crystal clear ...
0
votes
1answer
72 views
colorbox not loading in <head>
I can not get colorbox fully loaded.
I am trying to add color box to use in my plugin admin.
I do not need it for the front end.
I can get the css but can not get jquery.colorbox-min.js or the ...
0
votes
2answers
399 views
How to remove unnecessary elements in the HTML document head
Is there a plugin or something that can help me out with deleting unnecessary elements in my code?
I am in charge of fixing a WordPress site and have been asked to remove the following elements that ...
0
votes
2answers
110 views
adding meta data using plugin to top of head
It seems if you use the wp_head hook as an action to put your custom metadata into the head tags of your page, it is dependent on where the theme you are using calls the wp_head. In my case, it is at ...
0
votes
1answer
135 views
Why would wp_head() cause the menus to break?
I've done a few and sometimes ive noticed that when I try to implement some plugins, widgets, etc, they don't work.
When I add the wp_head() function right before the closing head tag, Then they ...
0
votes
1answer
272 views
wp_head function outputs after <head>
I have a function in my functions file where i output Google Analytics code.
function mytheme_trackingcode(){
$mytheme_option = mytheme_get_global_options();
$tracking_code = ...
0
votes
1answer
175 views
making a plugin that moves other plugins wp_head actions to wp_footer
I am grappling with implimenting jQm on wordpress and have hit the obstacle that most plugins dont work on jQm ajax loaded pages.
However, taking the example of the sharethis plugin, I have found ...
0
votes
1answer
150 views
how can i send this to wp_head - escape problem
how can escape this char ----> ;
i ask becuse i want to use this to send some javascript
to the head using wp_head
this is want i want to attach to wp_head:
add_action('wp_head', ...
0
votes
1answer
2k views
How to load a stylesheet into wp_head from a custom widget?
The code below is part of a widget that goes with my theme. I'm trying to include a stylesheet that the widget needs by placing an add_action call to wp_head. However, the function never fires in this ...
0
votes
1answer
608 views
How to remove a meta description or other <head> contents
I have a plugin that generates a meta description or title as two of its features. However I run into the problem of other SEO plugins possibly being installed, and ending up with two meta ...
0
votes
2answers
341 views
Remove_action inside a function
HI there,
I want to remove the actions added to wp_head by a plugin but only in certain circumstances.
Here is code that doesn't work:
if (is_single() && get_post_type() == 'tenant') {
...
0
votes
1answer
268 views
How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
By default, Wordrpess sites have at least 2 URLs that can be used to reach the home page:
www.site.com/
www.site.com/hello-world
Both these URLs point to the same page, the default "hello world" ...
0
votes
1answer
38 views
output specific location in the header
Is there a way in which I can output some code in the header and choose it's location? some where like wp function add_admin_menu (where you can choose the placement).
0
votes
0answers
46 views
Why won't the action hook wp_head won't 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 the ...
0
votes
0answers
26 views
Removing “Blog Archive” from Headline when posting to Facebook
I followed some clear instructions about how to remove "Blog Archive" from the title in individual blog posts, yet when I post to Facebook, it's still showing up: (i.e.: The Littlest Winslow --> Blog ...
0
votes
0answers
75 views
Not validating HTML5 website due to wp_head and Content-Lang [closed]
I have energyshop.se which is a webshop in wordpress but on a blank theme so it doesnt look like a blog.
I have only 1 validation output error when Im trying to validate the html through ...
0
votes
1answer
461 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
25 views
Post Attachment missing head (stylesheets/js/what-not)
I am using a modified 2011 theme, I got the single post to look fine but my single attachment is not working.
I'm told this will default to the page.php if I do not have an attachment template. So, ...
0
votes
1answer
104 views
Data validation for inline javascript
I try to save inline javascript(Google analytics code) in wp-options table. But i can't figure out what validation function i shall use.
I have tried esc_js when saving to the database. But i can't ...
0
votes
1answer
199 views
I add some js files from a plugin to a specific location
How Can I add some js files from a plugin to a specific location with add_action
I am Using this widget:
...
0
votes
3answers
630 views
removing wordpress generated code from the head section?
Specifically, I'm talking about the following which gets added automatically:
1) <script type='text/javascript' src='http://mysite.com/wp-includes/js/l10n.js?ver=20101110'></script>
2) ...
-1
votes
1answer
41 views
new to javascript - using in <head> instead of functions.php, not loading correctly
Live site.
I've decided to incorporate javascript in my new theme; this is my first time doing so and have pieced together what I've down with help of blog posts and forums. I have the javascript ...
-1
votes
1answer
50 views
How can a 'scripts' directory be hooked into wp_head();?
So I'm trying to get my head round <?php wp_head(); ?>.
I understand that it loads in the stuff needed for plugins etc., but I'm using a theme that seems to be using it to load in scripts for ...