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

Add code into <head> on a per page/post basis

Is there plugin (or an easyish way) to add code to the <head> section on a per page/post basis? I have a multilingual website and I need to implement the rel="alternate" hreflang markup, so ...
0
votes
1answer
21 views

Clarity needed on usage of multiple 403 forbidden header() functions at the beginning of the plugin files

Just see the following code snippet. I have came across this in one of the plugins that I am reading now. if ( ! defined( 'ABSPATH' ) ) { header( 'Status: 403 Forbidden' ); header( 'HTTP/1.1 403 ...
-3
votes
0answers
6 views

Secondary Menu (storefront theme) not working after removing Search Bar

I wanted to delete, hide or something my search bar I found this question and the solution achieved taking out the search bar. add_action ('init', 'jk_remove_storefront_header_search'); function ...
1
vote
2answers
755 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

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
14 views

CORS header 'Access-Control-Allow-Origin' does not match “http://www.old-domain.com”

I am having problem on my website with SVG images. The website has been moved to public and i keep getting this error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the ...
0
votes
0answers
20 views

Disable or Modify Access-Control-Allow-Origin from Response Headers

I would like to know is that possible to modify or remove Access-Control-Allow-Origin from Response Headers Due to security reason, I need to change Access-Control-Allow-Origin from * to domain I ...
0
votes
1answer
14 views

Changing header banner dimension in child theme

I'm using Twenty Thirteen Child theme for my website running WP 4.5.3. I would like to change the header banner dimension to 900x480. The content of my twentythirteen-child/functions.php: <?php ...
1
vote
2answers
2k 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 (...
2
votes
2answers
4k 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' header....
-2
votes
1answer
545 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
0answers
27 views

Creating dynamic header and footer files

I have an external search engine and I need to create a page to add it to my site. The page will sit on an external server, on an external URL. They are copying in the HTML header and footer but ...
0
votes
1answer
447 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
852 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
21 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
votes
1answer
436 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
111 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
18 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
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
42 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
34 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
60 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
803 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
29 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
75 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
54 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
11 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
1k 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
2k 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
88 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
40 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
122 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
89 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
17k 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
263 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
21 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
87 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
33 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
50 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
217 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
216 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
58 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 - ...
1
vote
1answer
93 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
141 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
19k 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 ...