Rupam
Rupam

Reputation: 13

Create separate Blog Page on wordpress

i want to create a separate blog page design so how can i proceed this.

Also ,i have set the static front page home -> home page and post page->blog now i want to assign different design for blog page

Upvotes: 0

Views: 411

Answers (4)

Anjana Shyamlal
Anjana Shyamlal

Reputation: 408

  1. Create a page for blog in the backend.
  2. Create a custom template for this page querying all the posts. If you want to query a specific category you can do that too.

Custom template will start as follows:

<?php
/* Template Name: Blog */
get_header(); ?>

Wordpress loop to call posts:

    <?php query_posts('posts_per_page=-1');
    if (have_posts()) : while (have_posts()) : the_post(); ?>
        <h1 class="title"><?php the_title(); ?></h1>
        <div class="post" id="post-<?php the_ID(); ?>">
        <div class="entry">
            <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
        </div>
    </div>
    <?php endwhile; endif; wp_reset_query();?>
  1. Now assign this new template to the newly created blog page from the backend.

As you have created new template you can add your own class and ids and style according to your new design.

Upvotes: 1

nerob
nerob

Reputation: 21

Wordpress have some conditional tags that you can easily handle your template file based on different page, use this conditions, i hope it'll help you

if ( is_front_page() && is_home() ) { //for home page
  //homepage template
  get_template_part($slug);
} elseif ( is_front_page() ) { //Static home page
  //static homepage template
  get_template_part($slug);
} elseif ( is_home() ) { //blog page template
  // blog page template
  get_template_part($slug);
} else {
  //other template
  get_template_part($slug);
}

Upvotes: 1

softbrewery
softbrewery

Reputation: 501

You can make Home template:

/* 
   Template Name: Home
*/
<?php
    // here is Home page markup 

And at index.php you can set blog design. Like a

<?php
if (have_posts()): ?>
    <?php while(have_posts()) : the_post(); ?>
        <article>
         <?php 
         the_title();
         the_content(); 
         ?>
        </article>
    <?php endwhile; ?>
<?php endif ?>

Upvotes: 1

Dirk Hubregtse
Dirk Hubregtse

Reputation: 1

I am not familiar with Wordpress, but a quick look resulted in the following page. There is a tutorial on how to create extra blog pages in Wordpress.

http://www.wpbeginner.com/wp-tutorials/how-to-create-a-separate-page-for-blog-posts-in-wordpress/

Hope this helps!

Dirk

Upvotes: 0

Related Questions