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)

16
votes
3answers
7k views

Why won't wp_mail() let me set the From: header when plain old PHP mail() will?

When I use wp_mail( $to, $subject, $message, $headers ) (with values in place, of course), the email gets sent with a from name and email that isn't set anywhere I can find (not even in PHP or Apache ...
5
votes
3answers
2k views

WP function/filter for modifying http headers?

Is there a dedicated WP function, action or filter to use when adding/modifying the HTTP headers? For now I just hook a PHP header() call into the WP 'init' hook like this: add_action('init', ...
5
votes
10answers
5k views

Wordpress Plugin Development - Headers Already Sent Message

I'm developing Wordpress plugins. When i activate my plugin, i'm getting a message The plugin generated 293 characters of unexpected output during activation. If you notice “headers already ...
5
votes
3answers
434 views

Math notation on WordPress.com?

I am a new user with WordPress, and I would like to use mathematical formulas. I have been reading the mathjax pages for hours, such as this one and quite a few others. This may be a bad question, ...
5
votes
3answers
1k views

External page integrated into WordPress returns a 404 error

I have a script that I'd like to call via AJAX from my WordPress theme, it relies upon some core WordPress functions so I am including WordPress blog header like so: define( 'WP_USE_THEMES', false ); ...
5
votes
6answers
2k views

Add header and footer to WP backend

I want to add a header in the backstage in order to look more blend in like the frontend. Nothing much I want to add, just the header and footer is enough. The content section remains the original ...
4
votes
2answers
1k views

Why is wp_redirect() preferable to a standard PHP header redirect?

In asking a question about hooks and redirects, I was advised to use wp_redirect in place of the PHP header function. Just wondering why wp_redirect is preferable?
3
votes
1answer
113 views

Get file headers in custom file

in my one of my plugins i have modules (kind of like plugins in a plugin), is there a function like get_plugin_data() or wp_get_theme() that will allow me to get the header section of a custom file ...
2
votes
2answers
162 views

Hook for URL request

I would like to make XML files downloadable, instead of allowing the browser to displaying them inline. I know I can use the Content-Disposition: attachment HTTP header (of course, better solutions ...
2
votes
2answers
6k views

How to add code to Header.php in a child theme?

I'm creating a child theme for the first time and I had a few questions regarding code added to header. In a non child theme there is certain code I add to my header.php file such as google ...
2
votes
3answers
2k views

Adding rel=“next” & rel=“prev” for paginated archives

Does someone perhaps know a plugin or snippet (besides Yoast's WordPress SEO) to accomplish this perhaps? Pagination with rel=“next” and rel=“prev” The only thing I've come across seems to be an ...
2
votes
3answers
4k views

How to set custom cookies before output

What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?
2
votes
2answers
400 views

What code do you use to generate the text to go into the HTML title tag?

The question title says it all. Myself I just stick with the default code from one of the packaged templates that comes with WordPress out of the box: <title><?php /* * Print the ...
2
votes
1answer
126 views

AJAX issue - Uncaught SyntaxError when processing Zip File

I'm creating an application that will allow a user to fill out a form and then have a customized zip file downloaded for them upon submit. I'm utilizing AJAX to accomplish this task. ...
2
votes
2answers
621 views

Call to undefined function get_header() in index.php

I am trying to create a theme. I created a header.php file and call this file in index.php using <?php get_header();?> When I try to run my index.php file it shows this error: Call to ...
2
votes
5answers
645 views

Some Themes do not have a header.php and footer.php how are they doing it?

Some themes that I have seen such as the (famous) thesis or even a few other not so famous themes have just an index.php (which has nothing in it), functions.php (call's their framework) and a ...
2
votes
1answer
5k views

Auto-refresh page every minute?

How do I make a WP page (w/ dynamic content) auto-refresh every minute? With PHP, I'd use a "Refresh:" header, and in HTML I could use a HTTP-EQUIV tag or something. However, WP generates headers ...
2
votes
1answer
106 views

What is the Wordpress Pinecone sitting on top of? [closed]

Does anybody know where wordpress gets their banner images? Perhaps we could find the original photo? I'm curious just what exactly this pine cone is sitting on top of.
2
votes
1answer
181 views

Custom Post Type Events Archive Grouped By Month

I'm currently trying to get my events listing code to print out headers by Month. So basically this: October event event September event event etc... Right now it just keeps echoing ...
2
votes
0answers
119 views

Additional Option on Custom Header admin

I would like to extend the Custom Header class to include an animation feature for the header graphics. Essentially, I'd like to add another possible value for the radio button for randomization. The ...
1
vote
2answers
138 views

What is the advantage of using header-catname.php over is_category('catname');?

Let's say I have a category named as catname (the slug would be catname). I want the header styled differently when visitors open the category catname. The article on Ghacks explains how to create a ...
1
vote
5answers
2k views

How to load a jQuery script last?

How to get this to load last? <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("div.domTip_tipBody").mouseover(function(){ jQuery("#yyy ...
1
vote
1answer
60 views

if/else on custom query gives 200 OK when condition not met?

What? I am modifying my theme to show comments of a post on a separate page. How? Mostly based on this answer but with improved checks and code. So this is what my page-comments.php (kinda) looks ...
1
vote
5answers
989 views

How to rotate the header image per day?

I'd like to have my header banner change every day, chosen (e.g. randomly) from a list/folder of images. So far I only found plugins that select a random banner per post or per page view, neither is ...
1
vote
4answers
2k views

The plugin generated 80 characters of unexpected output!

I'm getting this message each time I activate my plugin: The plugin generated 80 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with ...
1
vote
1answer
608 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 ...
1
vote
1answer
149 views

Echo URL of large version of Featured Image

I use this plugin to echo the URL of a post's featured image in the header: <?php /** Plugin Name: Post Thumbnail FB header */ function fb_header() { // Not on a single page or post? Stop ...
1
vote
2answers
448 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
1answer
909 views

Add social icons in a theme through custom admin menu

Is it possible to make a theme with an option of configuring social icons with links through the custom header control panel? I googled it and found nothing that could help me, any help on that topic ...
1
vote
1answer
279 views

How to remove the header from all pages except home?

I have a Template Monster WP theme that I need to remove the headers from all pages except home. I have read several posts on this, but my code is a bit different. Can someone please help me? The ...
1
vote
2answers
758 views

Disable h1 and h2 from rich text editor combobox

In the Wordpress control panel, when writing a new post, I would like to disable the Header 1 and Header 2 from the text formatting combobox, because I already use them on my theme (h1 for blog name ...
1
vote
1answer
98 views

Get search.php results in header.php?

I want one image in header.php to change for different pages. The function in header.php looks like that: if(is_archive()): //change image to "Archives" endif; if(is_404()): //change image to ...
1
vote
2answers
1k views

Adding custom code into header.php using a plugin

I have a bunch of code that I tend to put into the header.php of every site I do which are specific to Internet Explorer. I was wondering if there was a way to insert code into a 'standard' ...
1
vote
3answers
1k 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
2answers
326 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
460 views

Conditionally loading Facebook PHP SDK in shortcode

Since 3.3 we can enqueue scripts conditionally right in our shortcode functions, but when I tried to do this with some PHP class (uses session_start() in the __construct() function) as you can guess ...
1
vote
1answer
247 views

What is the “proper” way to generate a javascript variable depending on a custom field value?

On my site I have some posts with a custom field "Name". Now, in case the post has "Name" set, I want to generate this code: <script type='text/javascript'> var FG_DONATE_BUTTON_PARAMS = { ...
1
vote
2answers
3k views

Show TwentyEleven header image only on home page

i am trying to remove the header from one page (actually all the pages exept the Home page) i did some research i found this code #post-xx .entry-title{display:none;} whereas the xx is the page ID . ...
1
vote
1answer
808 views

How to find out if page_for_posts is showing (in order to style menu item)

I have set a static page for posts (page id = 110). This page shold only be included in the menu when the user is logged in. The latter is achieved with the following addition to header.php (snippet ...
1
vote
1answer
1k views

How to remove header image in Twenty Eleven theme?

Please give me details on how to remove the custom header image in the Twenty Eleven theme.
1
vote
2answers
432 views

Adding an editable field to template?

I'm making a theme for a client (first time using Wordpress), and the client would like to have multiple site "descriptions" to be available. The first one as the main description, and the second one ...
1
vote
1answer
155 views

Show an image in my header.php

I want to let my customer choose any image (in my backend) and then it will be displayed in my header.php. i've found Image Widget, but it just show images in the sidebar. I want something like: ...
1
vote
1answer
424 views

Using PHP to toggle stylesheet and header image, set in cookie

I haven't done a lot of work with cookies or Wordpress before so I think I've been a bit over-optimistic in my quest :p I have created two themes for my site, night and day. I would like the user to ...
1
vote
1answer
266 views

Mysterious HTTP 404 header in my own scripts

I have a WordPress 3.5.1 + nginx configuration. Its nginx configuration is this: server { root /mysite/public_html; server_name wp.mysite; location / { try_files $uri $uri/ ...
1
vote
1answer
103 views

pull non-wp site into content area of wordpress -or- pull wp header into non wp site?

I am building a site which has a ecommerce nature that is not able to be tied directly into wordpress. What my goal is to have a constant header that is generated by my wordpress header on all pages ...
1
vote
2answers
511 views

3 blogs on one site with the same header menu?

Person X has default SITE with an integral blog. Person X also has SITE 2 with Blog 2 and also SITE 3 with Blog 3. Is it possible to have on the DEFAULT SITE HEADER MENU something like this: HOME ...
1
vote
1answer
83 views

How to change header dimensions in Wordpress?

How can I alter the requirements for the header dimensions so that I can take an uncropped image and fill the top section (centring the whole image) instead of having white space at the top? I would ...
1
vote
0answers
2k views

Unable to stream pdf: headers already sent problem in dompdf [closed]

I have used dompdf to display the user information in admin of my wordpress project. While generating the PDF file it works perfectly in my local server. But in live server Unable to stream pdf: ...
1
vote
1answer
8k views

How to create a fixed header and scrolling content area

I've bee experimenting with a site I'm working on. My client wants the header with its nav and logo intact, so visitors always have the ability to access the navbar while scrolling to read the page ...
0
votes
2answers
4k views

Admin bar and fixed header issue?

I've styled my header to have a fixed top position. While logged in to wordpress, the wp admin nav bar covers the top section of my header making imposible to access my top navigation. I would like ...