Title: Adding custom post types into latest post grid plugin
Last modified: August 31, 2016

---

# Adding custom post types into latest post grid plugin

 *  Resolved [Trell](https://wordpress.org/support/users/thisnluv/)
 * (@thisnluv)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/)
 * I have a masonary styled grid on my blog and I am wanting to create a custom 
   post type for my instagram posts, and shop feed items.
 * For example:
 *     ```
       <script type="text/html" id="post-item-template"><div class="item post" data-type="post">
       	<div class="post-item {text_color}">
       	<a class="btn overlay-btn" href="{url}">
       		<figure class="image post-image">
       			<img src="{image_url}">
       		</figure>
       		<header class="header">
       			<span class="label">{category}</span>
       			<h3 class="title post-title">{title}</h3>
       			<span class="read-more-btn tertiary-btn">read more</span>
       		</header>
       	</a>
       </div></div></script>
   
       <script type="text/html" id="instagram-item-template"><div class="item instagram {size}" data-type="instagram">
       	<div class="instagram-item ">
       	<a class="btn" href="{url}" target="_blank">
       		<figure class="image instagram-image">
       			<img src="{image_url}">
       		</figure>
       		<div class="instagram-meta meta">
       			<div class="instagram-logo">
       				<i class="icon-instagram icon"></i>
       				<span class="name">@thehautepursuit</span>
       			</div>
       			<div class="instagram-stats stats">
       				<span class="likes">{likes}</span>
       				<span class="comments">{comments}</span>
       			</div>
       		</div>
       	</a>
       </div></div></script>
   
       <script type="text/html" id="product-item-template"><div class="item product {size}" data-type="product">
       	<div class="product-item {size}">
       	<a class="btn overlay-btn" href="{url}">
       		<figure class="image product-image">
       			<img src="{image_url}">
       		</figure>
       		<header class="header">
       			<span class="label">THPSHOP</span>
       			<h4 class="title product-title">{title}</h4>
       			<span class="price">{price}</span>
       			<span class="buy-btn tertiary-btn">buy now</span>
       		</header>
       	</a>
       </div></div></script>
   
       <script type="text/html" id="custom-item-template"><div class="item custom {size}" data-type="custom">
       	<div class="custom-item {text_color}">
       	<a class="btn overlay-btn" href="{url}">
       		<figure class="image custom-image">
       			<img src="{image_url}">
       		</figure>
       		<header class="header">
       			<span class="label"></span>
       			<h3 class="title custom-title">{title}</h3>
       			<span class="read-more-btn tertiary-btn">read more</span>
       		</header>
       	</a>
       </div></div></script>
       ```
   
 * This is an exmaple from a [live site](http://thehautepursuit) that I am wanting
   to emulate…
 * How is this done? Any reference material or advice would be great…

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052664)
 * Hi,
 * Here’s a handy guide for querying custom post types in your templates: [https://pippinsplugins.com/querying-custom-post-types-in-your-theme-templates/](https://pippinsplugins.com/querying-custom-post-types-in-your-theme-templates/)
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052669)
 * FYI, you do not need to create a new query as suggested in the article linked
   above. Though it will work, it’s not very efficient to toss out the original 
   main query and make a new one. I prefer to use ‘[pre_get_posts](http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts)‘
   action to alter the main query to my liking _before_ it is run.
 * The above linked article wants you to run the main query, then ignore the results
   and make a new one. However, if you _are_ using the main query, then running 
   a second query to get more content for a different section on the same page, 
   then creating a new query as suggested is the way to go.
 *  Thread Starter [Trell](https://wordpress.org/support/users/thisnluv/)
 * (@thisnluv)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052670)
 * Is this all necessary to just get an instagram photo and its likes onto my feed
   as a post in my grid feed?
 * Geesh..
 * In my grid builder I have the option to tick and load ‘posts, portfolio items,
   grid items’
    I was just wanting to add an ‘instagram’ post type that would be
   a square instead of the rectangles I have on my blog.
 *  Thread Starter [Trell](https://wordpress.org/support/users/thisnluv/)
 * (@thisnluv)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052671)
 * Live example [here](http://thehautepursuit.com) with 3 post types.
    Blog posts,
   instagram posts, and shop item posts in a masonry grid.. am I off base here? 
   or is it more complicated than I’m suggesting?
 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052672)
 * How you do it, with `pre_get_posts` or with a whole new custom query depends 
   on what exactly you want to do.
 * I can’t say anything to your grid builder. What grid builder are you using? You
   should contact their support if you want to use custom post types in their plugin.
 *  Thread Starter [Trell](https://wordpress.org/support/users/thisnluv/)
 * (@thisnluv)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052673)
 * I’m using the Grid Builder Visual Composer elemnt. It says I can use a variety
   of different plugins to create different post types, I’m just now sure exactly
   how to do that.
 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052675)
 * I see. Unfortunately the wordpress.org forum policies don’t allow the support
   of commercial products here. The VC developer should be able to help you though!
 *  Thread Starter [Trell](https://wordpress.org/support/users/thisnluv/)
 * (@thisnluv)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052676)
 * Got it… Thanks..

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Adding custom post types into latest post grid plugin’ is closed to new
replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 8 replies
 * 3 participants
 * Last reply from: [Trell](https://wordpress.org/support/users/thisnluv/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/adding-custom-post-types-into-latest-post-grid-plugin/#post-7052676)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
