my header.php page got erased when i trying to post google tag manger code , how can i retrieve it, rest of the theme is ok

If it’s a prebuilt theme (i.e. you downloaded it from WordPress.org or bought it somewhere), go to the author’s website and download a fresh copy. If it’s a custom theme, you’ll need to rely on your own backups – perhaps you’re auto backing up to a Dropbox, or you’re using a host that provides file … Read more

Plugin alternative to wp-blog-header.php hacks?

For anyone else who needs it, I solved it as follows via a plugin: (1) The first block of code needed to be triggered with: add_action( ‘wp_loaded’, ‘redirect_block’ ); (2) The second block involving redirects was originally after the wp(); call in wp-blog-header.php, so in the plugin it is triggered as follows: add_action( ‘wp’, ‘redirect_old_style_urls’ … Read more

My first web wp-blog-header.phd

On the official Wp github repository you can find the file you are talking about, but maybe check your wp version before, so that you grab the version of the file corresponding to your wp install. https://github.com/WordPress/WordPress/blob/master/wp-blog-header.php

What is the function of wp() in wp-blog-header.php

From the WordPress source code: “Set up the WordPress query.” (wp-includes/functions.php) The wp() method in turn calls the WP->main (wp-includes/class-wp.php), which has the following description: “Sets up all of the variables required by the WordPress environment. The action ‘wp’ has one parameter that references the WP object. It allows for accessing the properties and methods … Read more

Body tag in header AND template/footer?

Structure your theme so you start the <body> in the header and you close the </body> in the footer (same thing for the <html> tag): header.php <html> …header content <body> <!— body is started in the header, used on every page –> index.php, page.php, single.php, home.php – etc …content footer.php …footer content </body> <!– body … Read more

how to add H1 in title site?

Simple mistake or a typo: if ( is_front_page() && is_home() ) : It should be: if ( is_front_page() || is_home() ) : You want to put h1 in both: static front page and blog index. Your condition with && won’t be true, if you use static page as front page.

Limiting conditional comment to home only in header.php

There are likely more elegant ways to do this sort of thing, but the quickest and easiest, using your code, would be to move the PHP conditional out of the CSS conditional. e.g. change this: <!–[if lt IE 9]><?php if(is_home() )?> <script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/27299/<?php bloginfo(“template_url’); ?>/scripts/unitpngfix.js”></script> …to this: <?php if( is_home() ) { ?> <!–[if … Read more