0

i need to convert a html structure to theme. So this is my html structure

<html>
   <head>
    .................
  </head>
<body>
   <div class="main">
      <div class="inner">
            ....
      </div>
  </div>

  <div class="footer">
    ...
  </div>
 </body>
 </html>

so for this in header.php

<html>
 <head>
  .................
 <?php wp_head(); ?>
</head>
 <body <?php body_class(); ?>>

in footer.php

<div class="footer">
  ...
 </div>
  <?php wp_footer(); ?>
 </body>
 </html>

So now my need is to

<div class="main">
          <div class="inner">
                ....
          </div>
      </div>

i need to write this main and inner div in a separate file and call this file in each template .is there any hook available ???

that is i need to append

 <div class="main">
              <div class="inner">

after body (or after get_header() )and i need to append

</div>
</div>

before <div class="footer"> or(before get_footer()) Please help .I don't want to re write header.php, footer.php for including this div.it is a seprate file or it is append via using any of the worpress hook .

  • To be honest, you are really better of adding those HTML structures in the correct files where it should be, so the bad news is, you need to alter header.php and footer.php. There is no exact hooks to properly add those divs where you exactly need them – Pieter Goosen Aug 12 '15 at 5:04
  • thanks Pieter Gossen. I know this solution .But my client didn't allow me to do this, that's why i am searching the solution. Is any jqery methods are avilable? – ron r Aug 12 '15 at 5:18
  • Possibly template parts could help? codex.wordpress.org/Function_Reference/get_template_part. This would allow you to segment the main body. – jdm2112 Aug 12 '15 at 5:48

Your Answer

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

Browse other questions tagged or ask your own question.