0

So, I'm using my wordpress with a static front page and then I have Blog link that opens the blog posts.

My question is, how can I apply a different template/styling only to that area?

1

Refer to the Template Hierarchy in Codex.

If you have assigned a static front page, the template that will take priority for that page is front-page.php, and the template for the posts (blog) page is home.php.

1

You can create a custom template for every page and assign it to that page from edit page screen in the admin.

WP Codex has an example about custom page template for "page of posts". That should fit your needs.

http://codex.wordpress.org/Pages#A_Page_of_Posts

As for just targeting different pages with CSS you can add a body_class() function which prints out a class for body element depending which page is displayed. Add it like this:

<body <?php body_class($class); ?>> 

More information about body_class() function: https://codex.wordpress.org/Function_Reference/body_class

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.