0

I want to make a large header with logo, navigation and centered title and some text below. I dont know how to make that centered title and text below so that end user can edit title and text in admin panel.

I have an idea to get some post data into header.

        $post = get_post($post_id = 1); 
        echo '<h1>'.$post->post_title.'</h1>'; 
        echo '<p>'.$post->post_content.'</p>'; 

Maybe create special page template for that purpose? How to tell wordpress that this page goes to header.

  • How about using the text widget? All you need is registering a place for it with register_sidebar(). – fuxia Jan 9 '17 at 11:07
  • Interesting idea. I need to think about this. – kilogram Jan 9 '17 at 11:14
  • Maybe I create settings page with 2 textfields – kilogram Jan 9 '17 at 11:29
1

This thing is based on your template.If your template allow you to add your own code then you can add this code in your template part.
In your active theme you can see header.php file, in this file you can add this code where it is suitable.

  • I know that. I am creating theme with underscores – kilogram Jan 9 '17 at 11:27

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.