How to add other blog page templates

Home Forums WordPress Themes – Premium Circumference How to add other blog page templates

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15961
    Open Table
    Member

    We recently moved our website to the Circumference theme and are getting many positive comments about the new look (thanks!). However, we have one major issue in that our overall design used a feature of our old theme that allowed pages with static information at the top followed by posts in a specific category. I have found a few plugins that allow you to list posts from a category, but they generally show the title of the posts, or additional information – but in their own format. I’d really just like to create a new page template based upon the current template used for the “blog” page. What code will I need to copy for that page? Does this make sense?

    #21106
    Shekhar Bhandari
    Participant

    Hi Open Table,

    To make a new page template that shows certain categories pages, You need to follow the below steps;
    1) Create a .php file in the themes page templates folder, for example: category_simple.php
    2) Copy all the below code and replace the category name with the category that you want in

    query_posts(array('category_name' => 'shekhar'));

    3) Remember to change the template name as your wish.
    3) Save the file and go to pages and choose the page templates.

    
    
    
    
        
    
    <?php $blogstyle = get_theme_mod( 'blog_style', 'blogright' ); switch ($blogstyle) { // Right Column case "blogright" : echo '
    '; // get specific category pages query_posts(array('category_name' => 'shekhar')); if ( have_posts() ) : while ( have_posts() ) : the_post(); // get the article layout get_template_part( 'content', get_post_format() ); endwhile; // get the pagination circumference_paging_nav(); else : // if no posts get_template_part( 'content', 'none' ); endif; echo '
    '; break; // Left Column case "blogleft" : echo '
    '; echo '
    '; query_posts(array('category_name' => 'shekhar')); if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; circumference_paging_nav(); else : get_template_part( 'content', 'none' ); endif; echo '
    '; break; // Left and Right Column case "blogleftright" : echo '
    '; echo '
    '; query_posts(array('category_name' => 'shekhar')); if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; circumference_paging_nav(); else : get_template_part( 'content', 'none' ); endif; echo '
    '; break; // Wide Column case "blogwide" : echo '
    '; query_posts(array('category_name' => 'shekhar')); if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; circumference_paging_nav(); else : get_template_part( 'content', 'none' ); endif; echo '
    '; break; } ?>
    <?php get_footer();

    Thanks.

    #15962
    Open Table
    Member

    Thanks, I’ll give it a try!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.