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
8k 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
2answers
210 views

Auto get_header and get_footer on every template?

Is there a way to automatically run get_header() at the beginning of template and get_footer() at the end of it? Currently my code is too repetitive with those calls. I've been looking for a way to ...
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
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
3answers
463 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
3k 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
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?
3
votes
1answer
137 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
174 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
3answers
3k 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
2answers
71 views

How to stop loading multiple copies of jquery

My wordpress header.php and function.php is given below.please help me to modify my php code to stop problems due to loading jquery multiple times. My plugins and themes are loading jquery multiple ...
2
votes
2answers
1k 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 ...
2
votes
2answers
7k 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

How to prevent wordpress from loading old versions of jquery in wp_head();?

I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() ...
2
votes
2answers
403 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
167 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
910 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
824 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
6k 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
110 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
191 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
129 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
144 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
3k 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
73 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
1answer
770 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
5answers
1k 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
188 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
510 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
1k 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
321 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
21 views

Page source contains an http item that makes page insecure; but in php files it's written as https!

I can't seem to figure this out! I set up my site (https://goinspire.com/secure-payment/) to be https, but instead of the lock symbol I see a warning symbol. According to http://www.whynopadlock.com/ ...
1
vote
1answer
103 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
2k 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
2k 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
388 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
496 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
269 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
897 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
2k 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
471 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
167 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
0answers
29 views

wp-comments-post.php file returns a blank page

When i post a reply to my blog, it's return a blank page to me. It seems that happens because of this code in wp-comments-post.php if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { header('Allow: ...
1
vote
1answer
37 views

Strip HTML comments from plugins in header/footer

Would anyone know a function or how to remove <!-- plugin inserted stuff--> from the header and footer so that they won't be visible when viewing source?
1
vote
0answers
49 views

404 or ugly page on IE, but Firefox, Chrome looks perfect

I have a variation of this issue. Was happening before and after new theme. I was getting 404 in IE, now sometimes get partial page that looks horrible. Contents can vary when I refresh. I have no ...
1
vote
1answer
560 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 ...