title: Wordpress– How to include custom post type content in a template?
body: <p>I am using a custom post type and have got it to show up in the Wordpress admin area. This is part of my functions code:</p>
  
  <pre><code>//CUSTOM POST TYPE
  add_action( 'init', 'create_post_type' );
  function create_post_type() {
    register_post_type( 'slick_slider',
    array(
    'labels' =&gt; array(
      'name' =&gt; __( 'Main Slider' ),
      'singular_name' =&gt; __( 'Slider' )
    ),
    'public' =&gt; true,
    'has_archive' =&gt; true,
  )
  );
  }
  </code></pre>
  
  <p>My problem is that I need to insert these custom post types into a template. I've tried using this code to do that:</p>
  
  <pre><code> &lt;?php if (have_posts()) : while (have_posts()) : the_post();?&gt;
       &lt;?php $slick_slider_values = get_post_meta( get_the_ID(), 'slick_slider' ); ?&gt;
   &lt;?php endwhile; endif; ?&gt;
  </code></pre>
  
  <p>But it does not work. Any idea what code I need to get the CPTs to display correctly within the template page?</p>