HTTP headers are what is sent to the browser before the page markup. They often include the page MIME type, charset, status code and encoding. Headers are often overridden to change the page MIME type or redirect the user.

learn more… | top users | synonyms (1)

1
vote
0answers
29 views

How do you log a user out with wp_logout?

I can get wp_logout to work, but not without generating lots of warnings ('PHP warning: Cannot modify header information - headers already sent'). wp_logout calls wp_clear_auth_cookie, which calls ...
0
votes
1answer
27 views

Change header menu login-logout without changing main menu

I'm trying to change the header menu, such that it looks different when it is logged in and logged out, without changing the main menu. function my_wp_nav_menu_args( $args = '' ) { if( ...
0
votes
1answer
16 views

Reduce Page loading time

am trying to reduce page loading time by flush() php function just before in header.php wordpress file. Am using W3TC and CDN so that will work or it will be an unused modification?
0
votes
1answer
17 views

What is this HTTP_REFERRER “WordPress/4.1.2”

On our website we have huge traffic with same IP and referrer "WordPress/4.1.2; http://www.xxxx.com". The log line looks like: 62.24.2.2 - - [22/Apr/2015:17:28:15 +0200] "GET ...
0
votes
0answers
26 views

Headers Already Sent

I know this is a favorite error! I understand the principles but I can't see why this code would create this error. page.php includes a get_template_part. I have a test page that renders and does a ...
0
votes
1answer
21 views

Where are the contents of WP_Head

I'm building a theme based on underscores. In the header I'm finding some code for a margin-top but I can't seem to find the source in order to get rid of it. I looked in functions hoping it was ...
0
votes
1answer
29 views

Changing header text from uppercase to normal [closed]

All header text is uppercase. In main-style.css this works: h1, h2, h3, h4, h5, h6 { margin:0; text-transform:none; } but, when I do any changes in Appearance > Customize or in Cherry ...
0
votes
0answers
34 views

Save_post action hook using the add_settings_error function leads the “cannot modify header…” warning

I am fiddling on that for quite a while. I've asked a similar question already over here. Since then i've dropped according to recommendation the transition_post_status action hook as well as the ...
0
votes
0answers
10 views

Fade In/Out Header Isn't Working in Wordpress [duplicate]

The following code works in an HTML file, but doesn't work when I put it into Wordpress, so I'm assuming I'm doing something wrong according to the Wordpress framework. Here's my Code: ...
1
vote
1answer
47 views

An echo line in a transition_post_status action leads to “cannot modify header information - headers already sent by”

I tried to set up an action hook with transition_post_status. Inside I wanted to set up a few conditional statements. To see if everything works I wanted to place a debug statement. Problem is as soon ...
0
votes
1answer
22 views

How to use only scripts from new theme?

I'm a bit new to WordPress so please forgive me if is a duplicate question. I created new theme with simple file structure: functions.php footer.php header.php index.php style.css js/ I'm trying to ...
0
votes
0answers
33 views

Create Notification on Top Bar

I want insert to top on wrapper and top wp admin bar, like this: http://getconversion.com/products/gc-message-bar/ but i always fail... Can i use jquery prepend after body? <style> ...
0
votes
1answer
20 views

How can I selectively insert a header for my shop page in woocommerce? [closed]

I use a this line of code in my sites in order to change my header (and hence my css) depending on what template I'm using: <?php include ('otherHeader.php'); ?> however, with woocommerce ...
0
votes
1answer
24 views

Create a google friendly header with text and logo

I want to customize my current header in wordpress and include a logo in it. The following solution works: <header class="site-header"> <div class="wrap"> <a ...
0
votes
3answers
168 views

wp_redirect() - headers already sent

I am trying to use wp_redirect() to redirect the user after successfully submitting a signup form on the page. It's not working and shows the following error: Warning: Cannot modify header ...
0
votes
0answers
40 views

Add login and register controls at the header top right corner

I want to add login and register at the top right corner in the main menu of wordpress site. So is there a plugin out there which can do this and login and password textboxes should show horizontally ...
0
votes
2answers
36 views

Import a header template from another theme

I have a multisite WordPress project with a main site using Theme A and all 'sub'-sites using Theme B. Both Theme A and Theme B are Child Themes. I want to import the header file from Theme A into ...
0
votes
1answer
8 views

show wordpress data without headers

I need to use list of posts from wordpress in my project to generate XML. I have my own php script. In this script i use require_once ('wp-blog-header.php'); and i am retrieving list of posts ...
0
votes
2answers
32 views

How to add Post Tags to a new <meta> element in header.php?

How to add Post Tags inside a new element in header.php? I'm probably overlooking an obvious function in the WordPress Codex. I have tried adding these to header.php: <meta name="page-tags" ...
0
votes
1answer
21 views

Top Nav submenus wpon't stay open - only in FF and only sometimes [closed]

I've been up and down my header and nav trying to find why the top nav submenus won't stay open about 50% of the time. This doesn't happen in any other browser, but it's a significant enough issue in ...
0
votes
1answer
35 views

save_post hook - headers already sent?

I'm trying to create a very simple alert for each time a post is created or updated with the below... add_action( 'save_post', 'updatedAlert' ); function updatedAlert() { echo ...
1
vote
0answers
78 views

Wordpress 4.1 header image problem

I want to use a moving .gif as my header image in wordpress 4.1. In previous versions I could skip the cropping step and leave the image as is, and it would let me pick a moving gif as my header ...
2
votes
2answers
298 views

Loading different JS for http and https

I'm using a third party JS file. And they have both http and https version. My site have some pages loading in https while most of pages are in http. Now my question is could I do something in ...
0
votes
2answers
84 views

How do I make my plugin load before the headers are output so I can redirect wordpress?

I wrote some code, that helps secure my clients files, and added it to wordpresses function file. however, whenever updates come in, it obviously overwrites my function. So I wanted to create it as a ...
0
votes
0answers
15 views

Most optimal way of starting fresh, without using other theme or dropping old files?

I have an unusual situation: A website with very trashed styles.css (thousands of lines of trashy code), around 70+ custom templates, tons of js libraries loaded. First reaction was, lets start fresh ...
0
votes
0answers
53 views

Possible to add author avatar to header so displays for all, not just registered/logged users?

I have a wordpress site and here is the page where I am trying to display the avatar & user name in the header, listmenow.com/default Is it possible to display the avatar & user name for the ...
2
votes
1answer
388 views

Why is there a link tag with rel “profile” pointing to gmpg.org?

I found this <link rel="profile" href="http://gmpg.org/xfn/11"> in header.php file of WordPress theme. What will happen if I don't use this? What will happen if I use this ?
0
votes
1answer
223 views

If Modified Since HTTP Header

I am trying to enable 304 If Modified Since HTTP header in my WordPress site. After doing lot of Googling I find out a site where the author said to put the following line at the very end of wordpress ...
0
votes
0answers
24 views

Getting comment-reply to load

I am trying to get the comment-reply.js script to work, and at the moment I am having problems including it in my pages. Currently, I am using the following in my header.php file: <?php if( ...
0
votes
1answer
74 views

Different custom header image on different page

I am now creating a website for my client, this client wants me to make each page of the section of header image able to be easily uploaded by them in wordpress admin panel. This is the code I have ...
0
votes
2answers
73 views

Enqueue stylesheet in plugin for wp-login.php

What I have: A basic plugin that's calling a stylesheet contained in the plugin folder: function my_login_enqueues() { // First attempt: //wp_enqueue_style( 'custom-login', ...
0
votes
0answers
30 views

Override theme metadata in header

I've recently purchased and heavily customized a new WP theme, but am having problems with metadata. When posting a link to the in Facebook, the meta data pulls in the theme author name ... As we've ...
1
vote
3answers
7k views

Can't get a JSON object in response to an ajax request with wp_ajax

I have a problem with WordPress and ajax. This is my javascript part (I trimmed it a bit): var posts = $.ajax({ type: 'POST', url: ajaxurl, async: false, dataType: 'json', data: ...
0
votes
1answer
88 views

Empty lines in header, how to remove them

I'm making a theme from the _underscores theme, and after some development there are some empty lines in the header tag that I dont know where are they coming from. I suppouse that something is ...
0
votes
1answer
41 views

JQuery Plugins in Wordpress

I have been able to somewhat piece together how this should be done but I am really struggling with it. I want to use the Table Sorter plugin (http://tablesorter.com) in a custom Page Template to ...
0
votes
0answers
43 views

extra code in <head> - blank jquery function

I recently noticed that in the of my website (goinspire.com), there are 2 occurrences of the following code: <script>jQuery(function(){});</script> It looks like a script with a blank ...
0
votes
0answers
80 views

wp_mail() header From is not working

I created a contact form for my website which works fine except for one thing. The From header is not working correctly. Instead of using the $contact_name it uses my domain name as the name. I have ...
0
votes
1answer
64 views

Header Image instead of dynamic text

i'd like to change the dynamic text in the header that makes the title of the site with a logo i've designed. how do i edit this code to achieve this? <div id="logo"> <?php ...
0
votes
1answer
119 views

Headers already sent when I try to add headers via a shortcode

I've run into a headers already send problem while adding functionality to one of my plugins. I wish to send my 301 redirect header after some checks to deteremine if the contents of the page is ...
0
votes
1answer
683 views

Benefits to using CSS for header image instead of html img tag [closed]

I would just like to find out if there are any benefits to using css {background-image url();} instead using an img tag in the html when setting a header. I am using the Genesis framework on a ...
0
votes
2answers
304 views

Object method calling for global $wpdb in header.php

I am developing a Wordpress plugin in an object oriented way, and I would like to read data from the wordpress database using the global $wpdb variable. The global $wpdb variable is called from ...
0
votes
2answers
31 views

Code to Show for One post only in head

I want to add this code only for one post before </head> <link rel="alternate" hreflang="en-gb" href="http://abc.com"/> What code shall i use?
-1
votes
1answer
160 views

Cannot modify header information - headers already sent by

I am getting this error, when I am doing example.com/wp-admin Warning: Cannot modify header information - headers already sent by (output started at ...
0
votes
0answers
148 views

“imagejpeg” function is not working in wordpress

$image = imagecreatefromjpeg('http://localhost/test/wp-content/uploads/2014/09/city_81.jpg'); // choose a color for the ellipse $ellipseColor = imagecolorallocate($image, 0, 0, 255); // draw the ...
0
votes
0answers
12 views

Checking if certain header meta data is set

I'm trying to see whether <meta property="og:title" content="..."> and other OG properties are included inside the <head> of a WordPress site. Does anyone have an idea on how to do that? ...
0
votes
1answer
148 views

Loading second header.php for other homepage showing double header.

I am loading second header.php for other homepage but it displaying double header. this is how i call the second header <?php get_header('secondheader'); ?> and file name is: ...
0
votes
0answers
42 views

setCookie before headers are sent?

I was using this code in my plugin to set a cookie if a condition was met, however after updating to Wordpress 4.0 I got the message: Warning: Cannot modify header information - headers already sent ...
0
votes
1answer
81 views

Admin first hook that outputs HTML?

I think load-(page) is the first hook in the admin screen that deals with outputting HTML, but I'm not totally sure. Basically I'm looking for the equivalent to template_rediect or get_header, which ...
0
votes
1answer
141 views

How do I add Facebook OpenGraph meta tags for attachments in the header for a custom theme?

How do I add Facebook OpenGraph tags in the header when the header has already been called, and the values I need to add are obtained in the body? This is a highly customized theme (which I did not ...
0
votes
1answer
27 views

Download custom file in wordpress backend [duplicate]

I tried to implement a custom download link in the theme settings, section that will give the users to download there custom settings for the backup. I tried this option if( isset($_GET['download']) ...