Title: where to paste the code?
Last modified: August 31, 2016

---

# where to paste the code?

 *  [shellyshoham](https://wordpress.org/support/users/shellyshoham/)
 * (@shellyshoham)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/where-to-paste-the-code-3/)
 * hi
    I want to re-arrange the blog page so the posts will be shown in 2 columns.
   after making new view, where do I paste the code? thanks shelly
 * [https://wordpress.org/plugins/content-views-query-and-display-post-page/](https://wordpress.org/plugins/content-views-query-and-display-post-page/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Content Views](https://wordpress.org/support/users/pt-guy/)
 * (@pt-guy)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/where-to-paste-the-code-3/#post-7289910)
 * Hello,
    Blog page (or Category, Archive…page) is special page which uses template
   file in theme. For Blog page, it will use file home.php or index.php. In normal
   theme, these files will contain while loop: starts with **while ( have_posts())**
   and ends with **endwhile;**.
 * – If you found file home.php, please replace that while loop with **<?php echo
   do_shortcode(“[pt_view id=VIEW_ID]”); ?>**
 * – If you found file index.php, you should paste this
 *     ```
       if ( !is_front_page() && is_home() ) :
       	echo do_shortcode("[pt_view id=VIEW_ID]");
       else :
       ```
   
 * before **while ( have_posts() )**, and paste this
 *     ```
       endif;
       ```
   
 * after **endwhile;**.
 * with VIEW_ID is ID of View you filtered posts for Blog page.
 * But please remember that View maybe will not display exact posts as your original
   Blog page (because WordPress query on that page can be modified by theme or another
   plugin).
 * CV Pro plugin at [https://www.contentviewspro.com/](https://www.contentviewspro.com/)
   will help you to make it works perfectly, here is our document for this request
   
   [http://docs.contentviewspro.com/completely-replace-wordpress-layout-by-content-views-pro-layout/](http://docs.contentviewspro.com/completely-replace-wordpress-layout-by-content-views-pro-layout/)
 * Best regards,

Viewing 1 replies (of 1 total)

The topic ‘where to paste the code?’ is closed to new replies.

 * ![](https://ps.w.org/content-views-query-and-display-post-page/assets/icon.svg?
   rev=2932226)
 * [Content Views - Post Grid & Filter (Shortcode, Blocks, Elementor Widgets)](https://wordpress.org/plugins/content-views-query-and-display-post-page/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-views-query-and-display-post-page/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/)
 * [Active Topics](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-views-query-and-display-post-page/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Content Views](https://wordpress.org/support/users/pt-guy/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/where-to-paste-the-code-3/#post-7289910)
 * Status: not resolved