Home>Support>Suggestion for Vantage Premium, display custom post types with specific templates

Suggestion for Vantage Premium, display custom post types with specific templates

I have made a small change to single.php which allows various templates for the content layouts based on post type. For example if you have a post type of “project” you can display the content in a template called content-project.php . This may be useful for somebody, maybe even for the distributed product. Here is the full code of single.php with one line changed.

 

<div id="primary" class="content-area">
	<div id="content" class="site-content" role="main">

	

		 /** changed

		

		
			
		

	

	</div>
</div>



>

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 11 days ago Ian Messenger

    Sorry, the code seems to have been pasted badly, here it is again

    /** changed


    >

  2. 9 years, 11 days ago Ian Messenger

    and again!

    <?php
    /**
     * The Template for displaying all single posts.
     *
     * @package vantage
     * @since vantage 1.0
     * @license GPL 2.0
     */
    
    get_header(); ?>
    
    <div id="primary" class="content-area">
    	<div id="content" class="site-content" role="main">
    
    	<?php while ( have_posts() ) : the_post(); ?>
    
    		<?php get_template_part( 'content',  get_post_type( $post ) ); ?> /** changed
    
    		<?php if( siteorigin_setting('navigation_post_nav') ) vantage_content_nav( 'nav-below' ); ?>
    
    		<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
    			<?php comments_template( '', true ); ?>
    		<?php endif; ?>
    
    	<?php endwhile; // end of the loop. ?>
    
    	</div><!-- #content .site-content -->
    </div><!-- #primary .content-area -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>>
    
  3. 9 years, 10 days ago Andrew Misplon
    Hi, I Work Here

    Hi Ian :)

    Super, thanks for your feedback and for posting here, much appreciated.

    Don’t forget to store your changes in a child theme.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More