Articles of custom header

How to edit <head> codes of an individual page/post?

I want to run a JavaScript and I want to paste in inside the <head></head> tag I do not want to add it to the text-view area. How can I add this code snippet to an individual post (I mean not editing the headers.php)?

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 custom header (styled differently) when visitors open the category catname, achieved by creating header-catname.php and including it in category-catname.php with […]

Mysterious HTTP 404 header in my own scripts

I have a WordPress 3.5.1 + nginx configuration. Its nginx configuration is this: server { root /mysite/public_html; server_name wp.mysite; location / { try_files $uri $uri/ /index.php; index index.php index.html index.htm; } location ~ \.php(.*)$ { try_files $uri =404; include /etc/nginx/fastcgi_params; if ($uri !~ “^/uploads/”) { fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; } fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /mysite/public_html$fastcgi_script_name; […]

Loss of sharpness in jpg imported as header in twentyeleven

When importing a jpg into the header position (jpg created in indesign at 1000 px wide) for the twentyeleven theme, the photos are not sharp. what is causing this and how do I fix it?

Custom text-only header

I am developing a WordPress theme and would like to make use of a custom header on a the homepage (I’m using a custom page template). I would like this header to not include an image, but rather an <h1> and <h2> tag, and a link. So my question is the following – how do […]

Custom header images won't appear when set to random

I’m using a custom theme, developed from Boilerplate (some time ago). I noticed that the header images work fine when set statically, but fail to appear when set to random. I tried switching themes, and realized the same issue happens with Boilerplate, as well as Twentytwelve. Twentyten worked though, so I copied its code to […]

How to change the height of featured image in Twenty Eleven child theme

I am trying to change the height of my featured image to 350px in my child theme for Twenty Eleven. Can anyone help?? Note: I am using Twenty Eleven and there is no functions.php file in my child theme, because the parent theme’s functions.php file is included after the child theme’s functions.php file. When creating […]

How to use a svg as custom header?

I want to use a svg as a custom header in WordPress. I tried two ways: First I want the user to be able to upload their own svg as a custom header. So I enabled svg uploads in the functions.php: function cc_mime_types($mimes) { $mimes[‘svg’] = ‘image/svg+xml’; return $mimes; } add_filter(‘upload_mimes’, ‘cc_mime_types’); But that does […]

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 existing code reads: if ( 1 < count( $headers ) ) { echo ‘<div class=”random-header”>’; echo ‘<label><input name=”default-header” type=”radio” value=”random-‘ . $type […]

How to get the custom header image's alt text?

I’m using a custom header in my theme. My aim is to add an alt attribute to my custom header img element. My img element so far looks like this: <img src=”<?php header_image(); ?>” height=”<?php echo get_custom_header()->height; ?>” width=”<?php echo get_custom_header()->width; ?>” alt=”” /> How can I get the alt text of the custom header […]