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)

0
votes
1answer
17 views

Theme tweak to header [on hold]

My theme's support has been great generally but the following is out of their support policy (maybe because it could affect responsiveness). Is there any way I can align the navigation menu towards ...
0
votes
1answer
15 views

menu-item class missing on wordpress menu

I have this code in my header.php and its working properly except showing li's without menu-item class, its showing them with page-item instead. this is when i dont have a menu created from admin and ...
1
vote
2answers
746 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
2answers
1k views

Is there a way to enable Cross-Origin Resource Sharing for WordPress' ajaxurl?

WordPress already has a default URL for jQuery-WordPress application calls and it's well known as the ajaxurl. However, there are cases wherein one would need to enable Cross-Origin Resource Sharing (...
0
votes
2answers
101 views

Redirect to another page not working SOLVED! [closed]

I have a custom page template (1 file only, contains with CSS, HTML and PHP) with a form and it will send an email after the user click the submit button and it will redirect also to another page. ...
-1
votes
1answer
423 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: header-...
0
votes
0answers
100 views

Call PHP files like index.php?page=PAGEHERE

My main site calls PHP files like index.php?page=PAGEHERE and I am trying to get that to work with WordPress, but having trouble. Here's my website. Before clicking on the menu, you can see ...
2
votes
0answers
17 views

HTTP Header on specific page is application instead of text

Problem: clicking on (WP site that I developed) webejeeping.com/vehicles/ causes the generated php file to be downloaded instead of being rendered in the browser. MIME Type returns as "application/...
0
votes
1answer
831 views

Changing logo image in header.php upon language detection

So i'm designing a website that will feature the Polylang plugin for automatic language detection, but I've run into a bit of a wall with the logo image. It resides in header.php, but I can't think of ...
0
votes
1answer
437 views

setcookies and header send

I put simple php condition in the header.php of template as this : setcookie("test_time_".$cookie_id."", $cookies_times, time()+3600); The result always as this headers already sent , i use this ...
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 ...
1
vote
2answers
37 views

Add custom HTML to posts page

I want to add a header image via some custom HTML to the posts page but can't edit it with the pages menu in Wordpress. Is there a way to add the HTML in the specific PHP-File and which PHP do I have ...
0
votes
1answer
29 views

Wordpress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]

I downloaded a wordpress theme recently and i tried to run it but it gives me an fatal error shows that call to undefined fatal error(). Why this error generates ? I am a new bie to wordpress theme ...
0
votes
2answers
44 views

Using ob_start() in plugin

I'm learning how to build a WordPress plugin. In the sample plugin code, I have this PHP/HTML: ob_start(); // other plugin code <?php function plugin_rvce_options_page() { ?> <div> ...
1
vote
1answer
746 views

disable wordpress canonical tag meta

wordpress core automatically generates canonical tag in HEAD section: <link rel="canonical" href="http://blabla.com" /> how to disable/remove that?
0
votes
2answers
24 views

Javascript not working on index.php but it is working on single post's page

I am trying to use mathJax in my wordpress. According to the documentation at mathjax, the mathjax script url needs to mentioned in headers.php. Which is exactly what I did. And right now this is what ...
2
votes
2answers
2k 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 ...
2
votes
1answer
1k 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
73 views

How to load a different header based on post format?

I have a difficult question. What's the best way to load a different header based on a post format? I guess I could load another loop around the header but I noticed the site does slow down. This is ...
0
votes
1answer
41 views

Wordpress Install - “end of script output before headers” when running simple php script

I have a multi-site Wordpress installation for a client, and for one of the forms I need to do some manual database interaction as the feature is separate. The problem I'm having however, is that any ...
0
votes
1answer
10 views

Problem with adding custom post type meta to header by plugin

I'm trying to write a plugin by which a meta code will be added to specific post type header. I tried to use this code: function msc_header() { if ( is_singular( 'article' ) ) { echo '<...
2
votes
3answers
910 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 ...
1
vote
2answers
1k 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 ...
1
vote
1answer
76 views

My php header() function is not working [closed]

// Edit: I figured it out. Hours and hours of banging my head against a wall and it turns out all this needed was one simple line: ob_clean(); Somewhere in some included file there's probably one ...
0
votes
4answers
37 views

Wordpress Template not getting my Sub-Header File

My template works fine, however, its using my main header file, even though I have changed it to point to sub-header.php <?php /* Template Name: Sub Page */ get_header('sub-header'); ?>
0
votes
0answers
92 views

How to show twitter link preview (Card View)

I want to ask about my problem. I can't show twitter link preview for my website and for information, I just add this code i get from WP Beginners <?php #twitter cards hack if(is_single() |...
0
votes
1answer
52 views

Custom CSV exporter - Cannot modify header information - headers

In my admin dashboard, i created a custom module for report filtering using custom queries. I need to add another functionality which is to export these results to CSV. I tried to create a very simple ...
23
votes
5answers
16k 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 ...
-1
votes
1answer
148 views

Change the headers content type with wp_remote_post

Working with the remote API requests with WordPress. I have used wp_remote_post() function to request the HTTP data but I am unable to update the headers Content-type I am using the following code ...
0
votes
1answer
20 views

Dangers to allowing Access-Control-Allow-Origin: * for Feeds only?

I want to use a function like this to allow access to the feeds from a variety of services but my knowledge of the security implications is limited. I think I'm being safe by limiting the access to ...
-2
votes
1answer
23 views

How to get customable image header?

I'm creating new responsive theme. How do I get customable theme header image with text inside the image? For ie. Site title in the header image. I read about using add_theme_support( 'custom-header'...
0
votes
1answer
71 views

linking stylesheets and scripts with functions.php

I am following along with this tutorial. I am trying to link the javascript and css files that are usually linked in the header using wp_enqueue_scripts in functions.php. With what I have now, only a ...
0
votes
1answer
32 views

How can I prevent the Search Results Page from changing title?

I am trying to add the search feature to our site. I have the search feature located in the desired position on the page so I'm happy with that. My problem is that when the results are displayed, ...
0
votes
3answers
39 views

Need help with Access-Control-Allow-Origin

I have a little problem, I created a wordpress theme with documentation created with the site helpscout, to reduce the number of support ticket, I would like to do the same thing EDD: https://...
2
votes
2answers
4k 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 ...
1
vote
1answer
178 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 ...
0
votes
1answer
33 views

Requiring login for specific pages

I have 2 lines of code in my header.php file that exclude the header from an array of pages. The code looks like this: <?php if ( ! is_page( array ( 3599,3653,3684,3732,3737,3758, 3769 ) ) ) { ?&...
1
vote
1answer
167 views

Editing Header Titles of each details in woocommerce Order Email [closed]

I'm using flatsome theme, woocommerce plugin. On my thank you page I get the bank details, order details and customer details etc. but on customer order email, header TITLES of those details are ...
3
votes
2answers
57 views

Theme option : having the ability to select among several predefined headers

I'm in the process of creating my first theme, and I'm using Quark as a starter theme. I would like the theme to have various options, one being header selection. (let's say 5 different headers - ...
0
votes
1answer
369 views

End of script output before headers - multiple apache error_log errors

Not sure if these two problems are related but let me start with the title problem. Before you downvote for server related Q - if I put this on SE they will say it's wordpress specific due to the ...
1
vote
1answer
70 views

Sharing Header Components Across Multisite

I have a multi-site platform and I'm trying to share the menu that I have in main with other sites that are located in different folders. This is the PHP tag in the main that pulls the menu which I ...
0
votes
0answers
129 views

Access Control Allow Origin problem with CORS

I'm at wit's end. We're using CORS to go back and forth between a .NET environment and a WP/BuddyPress environment. I've added the Access-Control rule to the header in index.php, with no wildcard. ...
4
votes
3answers
18k 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 ...
0
votes
0answers
89 views

Full Width Featured Image Above Content & Sidebar On Posts

guys/gals I'm using the JustWrite theme and I am trying to figure out how to add a hero (or full width) image via functions.php in my child theme. All I want to do is grab the featured image from ...
0
votes
0answers
167 views

Cannat load admin-ajax.php. No access-control allow origin*

XMLHttpRequest cannot load ..../wp-admin/admin-ajax.php.,. No 'Access-Control-Allow-Origin' header is present on ... When on local WAMP it worked just to put header("Access-Control-Allow-Origin: *...
3
votes
1answer
33 views

Is it wrong to put header tags inside WordPress help tabs?

We're working on improving accessibility in our plugin. One of the rules for accessibility is apparently that you should have an h1 tag before any h2 or h3 tags etc. Normally that makes sense, except ...
0
votes
1answer
68 views

How to add css option to Header Image customizer?

I have added the Custom Header Theme Option to the Rowling theme. It works fine but I want to extend this by adding CSS controls in the customizer for backgound-size, and background-position. Please ...
7
votes
8answers
10k 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 ...
7
votes
4answers
5k 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', '...
6
votes
1answer
297 views

wp_headers vs send_headers. When to use each?

I've seen wp_headers and send_headers both used before for the same thing and I'm wondering how you're suppose to know which one to use and when... On the send_headers codex page there's an example ...