I am styling a template page as my front page, while I cannot style the page content separately from the header: when I try to add padding to the content, it is applied to the header together with the content. Please see below the code:
<?php /** Template Name: Front Page */ get_header(); ?> <div id=“content” class=“content-area”> <main id=“front-page” class=“home” role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php endwhile; // end of the loop. ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); ?>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Thank you very much in advance for your suggestions!
- The topic ‘How to separately style header and page content?’ is closed to new replies.