0

I am trying to add this function:

add_theme_support( 'custom-header' );

I would like this to somehow combine with multiple headers. I saw some code that was PHP that checked which template was loaded then add the image (header) that was defined in the code.

This is not totally optional since I want my theme to allow the user of the theme to change the header for his "buyers" template, the "sellers" template, so forth. Is there any way to make the 'custom header' page allow several custom headers that are called on different templates?

1
  • It is unclear what you mean by 'templates', do you mean page templates, post loop, archives, the whole site?
    – Wyck
    Commented Dec 16, 2012 at 17:42

1 Answer 1

-1

What you want to achieve is posible but not with WordPress custom-header feature because it's you can use multiple images in random sequence.

If you mean 'different page templates' you can simply hard code your images links in your templates, but this is not good solution.

Another solution is to write function which will check the name of page template and change header image.

If you need that functionality for normal users you need to create a new settings page for your theme. It should save to WP options information about template name and image for it.

7
  • I have a php code that checks the WP template name and adds the image (hard coded from the header) to the page. I need the user of the template to be able to set the header that is hard coded in the php without knowing php. The custom header function is nice because of it's back office application. I need to add a back office header upload page for each template... Anyone? Commented Dec 16, 2012 at 17:05
  • I improve answer for you, yes you need make a new page with settings for every page template, but it is not hard to achieve. Commented Dec 16, 2012 at 17:16
  • Thank you for your continued help. Is there someone that can give me an example of such an effort. I am not the most knowledgeable person for doing this. Please assist. What code would accomplish this... Commented Dec 16, 2012 at 17:22
  • If you are theme developer you should achive this with codex pages, idea behind that I just wrote in answer. On option pages you seve your settings to WP options and in header.php you read it and set the right link for header image. Commented Dec 16, 2012 at 17:27
  • Please do not suggest theme developers to hardcore anything like this, it's what makes bad theme developers..bad.
    – Wyck
    Commented Dec 16, 2012 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.