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 … Read more

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; … Read more

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 … Read more

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 … Read more

How to change default header image dimensions in twentyfourteen child theme?

I’m creating a child theme based on twentyfourteen and wish to change the custom header image dimensions. The custom header page states: Images should be at least 1260 pixels wide. Suggested width is 1260 pixels. Suggested height is 240 pixels. This appears to come from defaults set in /inc/custom-header.php: function twentyfourteen_custom_header_setup() { add_theme_support( ‘custom-header’, apply_filters( … Read more

Different custom header image on different page

I am now creating a website for my client, this client wants me to make each page of the section of header image able to be easily uploaded by them in wordpress admin panel. This is the code I have in functions.php: add_theme_support( ‘custom-header’ ); $args = array( ‘width’ => 950, ‘height’ => 150, ‘default-image’ … Read more

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 … Read more

How can I add a custom header to a custom template in a plugin without using the theme folders

There is a lot of documentation on how to create custom headers for a theme. For example, if I wanted to add a header named: header-custom.php I would add this to my template file: get_header(‘custom’); If custom-header.php was in either the same directory as the page template or the ‘root’ theme directory, the header will … Read more