Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [headers]

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.

0
votes
0answers
19 views

Change headers for one custom PHP file

I have a server.php file that I wish to host on the same server as my Wordpress site, that is required to send a POST message with a header of Content-type: application/json. Wordpress is preventing ...
0
votes
0answers
26 views

Customize wp_login_form appearance

I embedded a login form in my websites header for not logged in users. I added it using this code in my navigation-top.php: <?php if ( is_user_logged_in() ) { ?> <?php } else { ?> ...
0
votes
1answer
19 views

echo get_option in header template

I was trying to get this to work yesterday but my WP website is giving me trouble. This is my first attempt at creating plugin so please excuse me. I want to show an ad banner in header based on ...
0
votes
1answer
28 views

How to make JQuery load on top of head tag before everything

my website and plugins insert some jquery code between HTML tag and also whatever I do to insert jquery as a first script in the head section I can't get it to work I tried function ...
-1
votes
1answer
27 views

How to remove lines over text using Phlox theme with Elementor Pro?

I have been struggling a lot trying to get rid of a line that appears over the text of my home page. I am using the Phlox theme updated and elementor Pro for full compatibility. I already went into ...
1
vote
1answer
56 views

WordPress Redirect Not Working - AJAX Callback Response Not Picked Up

I cannot get a redirect working in my custom wordpress plugin. I have a button on a page which triggers an AJAX action which calls a function. In my function (which is definitely being called as I ...
0
votes
1answer
18 views

How to fix shifting header after installing speed / cache plugins?

After installing (and uninstalling) Autoptimize, Async JavaScript, BJ Lazy Load, and Leverage Browser Caching plugins, my header shifts back and forth on page load - can you help find the fix? I am ...
0
votes
0answers
13 views

How to access this element through Dashboard to modify its content?

I would like to access and modify the plugin(?) below marked with red circle through Dashboard. (i.e. not through the generated html). Actually I don't know whether it is plugin or a fancy heather or ...
1
vote
0answers
21 views

send_headers don't work on wordpress multisite

I have written a simple plugin to send some security http headers. I've tested it on various wordpress installations but on a wordpress multisite network it seems that the headers are not sended. The ...
0
votes
1answer
45 views

redirect not work

I have class: class users{ public function __construct(){ add_action('do_redirect', 'redirect'); } public function redirect(){ $url = get_site_url(null, '/welcome'...
0
votes
0answers
23 views

Theme header is loaded twice

I've custom theme, and in my header I have SQL query that increase a counter into the database. The problem is it's increasing twice or two different rows(one after another). The problem seems to ...
0
votes
1answer
61 views

Modify wp-admin page header 'viewport' meta data

The 'wp-admin/admin-header.php' file outputs 'viewport' meta data. It seems the value of the viewport is hard coded into the file. (See: https://github.com/WordPress/WordPress/blob/master/wp-admin/...
0
votes
0answers
17 views

wp_remote_get and htaccess preventing hotlinking based on referer, why can't i set referer using wp_remote_get?

I am setting up a site to grab images from another site that has hotlink prevention based on referer. On the image site in htaccess we have: RewriteCond %{HTTP_REFERER} !^https://(www.)?...
0
votes
0answers
19 views

Woocommerce + Astra Pro + Elementor header shop not change

I'm using a astra sites template for build my e-commerce. Customizing the header of my site I realized that in the shop page the header did not change according to the customization of the theme I ...
1
vote
1answer
25 views

Authenticate a user for current request

Is there a way for a WordPress plugin to authenticate a user for the current request? My plan is to authenticate users via a HTTP header containing username and password. Then this information should ...
1
vote
1answer
235 views

header and wp_redirect not working. cannot modify header information warning

Does anyone know another way to redirect without header(); giving me this error? wp_redirect doesn't work for me either... This is the error I'm getting: Warning: Cannot modify header information -...
0
votes
0answers
15 views

How to make custom_header_setup() image as background image?

I have created a function that enables Header Image in Wordpress (5.0.3) ACP. My HTML code treats that image as normal image (not background). <img src="<?php header_image(); ?>" height="<...
0
votes
0answers
24 views

Video Header in 2016 theme

I am using 2016 WordPress theme I have customized theme and added header media option in the customise dashboard. I can add video in the header but it's not showing up on the front page. Wordpress 5.0....
0
votes
1answer
38 views

How to include a query_vars value in document_title_parts?

I have a page template, used on a single page, which takes URL string parameters like this... http://www.example.com/mypage?tags=Publishing Facilitated like this... // Inherit the meta target ...
0
votes
0answers
28 views

The letter “i” appears capitalised even when I don't mean to capitalise them

For some reason, the letter "i" always appears as a capital (I) even when I don't want them to. Does anyone know of a possible fix? See below for an example. The word here is "Shopping". The theme I'...
0
votes
1answer
116 views

Serve text/html from wp-json API via WPEngine, headers not being set properly

I have read multiple entries in the WP Codex, numerous articles and Stack Exchange questions. I have a fully functioning API for a private plugin I am developing, but when moving it into production on ...
0
votes
1answer
31 views

Set og:image programmatically in custom single post with external images

I have created a plugin with a custom post type and the single post template pulls in photos from an external site. I would like to programmatically set the source for one of these images as the og:...
0
votes
1answer
28 views

Premature end of script headers: wp-mail.php?

I haven't edited wp-mail.php at all. I'm using the default WordPress file. I'm trying the whole submit post by email function that we know in settings (using gmail and pop3, if that's relevant). I ...
0
votes
1answer
24 views

Change header image size

I have a header image which looks great on desktop, however, when accessing the site on a mobile device, the image gets cut off in the middle. How can I make it that the image automatically rescales ...
0
votes
0answers
20 views

How can I add a logo to the hamburger menu?

I have a mobile hamburger menu setup, but I am having trouble adding my logo to the left of it. This is coded to go against the theme. Any idea on how I can add a clickable logo to the left of the ...
0
votes
0answers
174 views

How do I get the featured image to sit below the header in the twenty nineteen theme?

In the twentynineteen theme, the featured image in a post becomes the background of the post. Actually, it becomes the background of the header. I'm trying to get it sit below the header in each post ...
0
votes
1answer
29 views

setcookie() issues on running with HTTPS on WordPress

I have set 2 custom cookies to be saved when user clicks a button that runs the script to save the cookies. The issue is that I need these to be saved through HTTPS because I am using them on a store ...
0
votes
0answers
16 views

Warning: Cannot modify header information - headers already sent when trying to download a simple text file [duplicate]

I want to be able to click my "Export" button and have a text file downloaded. When I try this, I get the error: "Warning: Cannot modify header information - headers already sent ....". I have a ...
1
vote
1answer
22 views

Header style different on home and remaining pages

Would it be fairly simple to add different site header and menu styles and assign them to specific pages? I have very basic understanding of how CSS and php work and managed to customise the theme but ...
0
votes
2answers
31 views

Issues with if, else, and elseif statements

For my site, I need to have different header colors depending on the page it's on. Here's the code I have for my site that is working: <?php if ( is_single() && is_post_type('product') || ...
0
votes
1answer
23 views

Allow user to choose header style

I am working on developing a simple WP theme that our office will use as a starting point for any future projects that come in. My question is this: How would I go about adding functionality that ...
1
vote
0answers
20 views

How to properly modify WP Vary or any existing headers?

I have a site that currently have a some part of the headers like: Vary: Accept-Encoding, Cookie I want to modify it to be: Vary: Accept-Language I tried the suggestions here using this code ...
0
votes
1answer
202 views

Cannot modify header information - headers already sent during plugin activation

I am getting this error PHP Warning: Cannot modify header information - headers already sent by (output started at /home/zk2ba8xn663w/public_html/wp-includes/formatting.php:5100) in /home/...
-1
votes
1answer
171 views

Cannot modify header information - headers already sent

So I have a form on one page, which is submitting to admin-post.php, then there is a function in functions.php which is processing the form. It stores the input field data to database and then after ...
0
votes
1answer
105 views

Two same AJAX calls - one is working, other doesn't

I am developing a WP plugin. I have two same AJAX calls, one is working, and second one is giving me 400 Bad Request error for admin-ajax.php. ReadyState is 4, responseText is: " ↵ ↵ ↵ ↵ ↵ ↵ ↵ ↵ ↵ ↵ ...
0
votes
1answer
35 views

Wordpress site screwed up after adding Facebook Pixel inbetween header tags

Added my facebook pixel code between the header tags on my header.php theme file and now my website is all screwed up and not displaying properly. I tried deleting the facebook pixel code and saving ...
0
votes
1answer
59 views

Wordpress cookie issue on login: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

recently I had the problem where on login page Wordpress reported an error: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. This was asked ...
0
votes
3answers
208 views

Responsive header images

I just set up a WordPress site and have the same problem I have with all my other WordPress sites: The header image isn't responsive. It's 2,000 pixels wide regardless of how tiny the screen is. I ...
0
votes
1answer
26 views

How I can overlap my menu in my header picture

How I can overlap my menu in my header picture. I want the menu can be seen on the header picture. This is the example like I want. Thank you. Example :
1
vote
2answers
41 views

How to add a class to the <html> element?

I'm using the X-Theme in Wordpress and I ran into an issue where I needed a CSS class in the <html> tag, but only on one page. This is the code I added into my child theme header file: <!-- ...
0
votes
1answer
31 views

Debug in WP backend

The problem - I get these warnings each time I login to /admin page in WP. Depending on which browser I use, there are problems with these: Warning: call_user_func_array() expects parameter 1 to ...
0
votes
1answer
226 views

How to add close button to dropdown menu that also reverts to menu button on another click

I am creating a custom dropdown menu for my WordPress blog header. I did everything correctly but could not add close button that opens on first click and revert to default on another click. I mean ...
0
votes
2answers
67 views

Last-Modified header support doesn’t speed up server processing - want more

I’ve just added “Last-Modified” / “If-Modified-Since” header support for some pages on my site via the recommendation here, but I didn’t see a very noticeable client page load speed improvement. This ...
0
votes
1answer
77 views

“Cannot modify header information” means I can't use wp_redirect

I am working on a site where new users are expected to agree to read our site policy before they can proceed. Once a new user logs in, they are redirected to the policy page. To continue to the read ...
0
votes
3answers
25 views

How to deactivate the text, that appears, when you hovering over topbar tabs? [closed]

I want to deactivate the text, that appears, when you're hovering over topbar tabs (I've marked it red in the screenshot). Im using the Oshine theme. Greetz
0
votes
0answers
58 views

Duplicate Header and Footer

I am creating a new page template and also need to create a duplicate header and footer php template to use with the new page template. I have already duplicated each php file and named them header-2....
0
votes
0answers
22 views

Custom banner / header for certain posts or pages

Below is the code for my template-banner.php file. However depending on the post or page I want to display a custom banner. I have tried some plugins made for this however these do not work for my ...
0
votes
1answer
279 views

Enable CORS for getting an inline SVG by URL

TLDR; Is there a way I can enable CORS for SVGs in my WordPress back-end, so I can get them through a http request to a different domain? Ideally without having to touch .htaccess? What I'm aiming ...
-2
votes
3answers
73 views

CSS does not take effects and it doesn't show in inspect [closed]

Hi I am trying to do a simple thing for my header at https://blog.madesoma.com/, but I don't know what's wrong with it. .site-header { background-color: #473C93; } #branding-logo { float: left;...
0
votes
1answer
182 views

Change header.php of a specific Wordpress Multisite

I wish to change to change the header.php of child theme and add <meta name="theme-color" content="#ff6600" /> into it. However when using the editor under 'Network Admin', changes are ...