0

I wanted to add a custom option to select header and footer in every pages and post. I have two headers and two footers so I wanted to select every page. So please suggest me how can I possibly?

  • 1
    and why can't you write this code yourself, or copy it from some free theme? – Mark Kaplun Sep 4 '17 at 5:45
0

You can do this by Using template page as well as custom fields. Let us say your custom fields value are 1 and 2 for header your conditions will be.

if($header==1)
{
 get_header(1);
}
else
{get_header();}

And similarly for footer it will be

if($footer==1)
    {
     get_footer(1);
    }
    else
    {
      get_footer();
    }
  • Yes, I know. but I wanted to select a customer to changes page wise header and footer. – Vishit Sep 4 '17 at 6:15
  • Do you mean to make changes from frontend? – Pratik bhatt Sep 4 '17 at 6:29
  • I have three-four header and footers so I want to give options to the client as per pages. – Vishit Sep 4 '17 at 6:32
  • can you show me an example what do you need exactly. – Pratik bhatt Sep 4 '17 at 8:15
  • Same as client select header check screen shot: prnt.sc/ggu0bp – Vishit Sep 4 '17 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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