title: Wordpress: Display content from a Custom Post Type within a regular Post
body: <p>I feel like there is a really simple solution to this problem. However, after trying to solve it for about 3 hours unsuccessfully, I humbly come to you.</p>
  <h3>The Basics:</h3>
  <ul>
  <li>A custom post type, &quot; <em><strong>band</strong></em> &quot;, has been created, and has several
  custom fields (which were created through the <a href="https://wordpress.org/plugins/advanced-custom-fields/" rel="nofollow noreferrer">Advanced Custom
  Fields</a>
  plugin.)</li>
  </ul>
  <h3>The Question:</h3>
  <p>How would I get and display the contents (specifically custom field data) of a specific <em><strong>band</strong></em> entry (using its <em>ID</em> or <em>title</em> or <em>slug</em>) <em>inside</em> of a regular post? (see <a href="http://thisnewband.com/images/diagram.png" rel="nofollow noreferrer">diagram</a> below)</p>
  <p><a href="https://i.stack.imgur.com/RAHsz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RAHsz.png" alt="this diagram" /></a><br />
  <sub>(source: <a href="http://thisnewband.com/images/diagram.png" rel="nofollow noreferrer">thisnewband.com</a>)</sub><br />
  .</p>
  <h3>Methods to Trigger the Display of the Custom Post Type:</h3>
  <p><em>We have to provide the ID/title/slug so that it knows what</em> <em><strong>band</strong></em> <em>post's content to display</em></p>
  <ul>
  <li>Shortcode (such as <code>[band id=&quot;21&quot;]</code> ) (<em>added inside post content</em>)</li>
  <li>Custom Field (custom field name <code>band-id</code> where you can input the ID of the <em><strong>band</strong></em>)</li>
  </ul>
  <h3>What I've Tried and Why It Didn't Work:</h3>
  <ol>
  <li><p>Shortcode</p>
  <ul>
  <li>`[band id=&quot;21&quot;] inserted in post editor field</li>
  <li>Used <code>WP_Query</code> to query post with <em>type</em>=<em><strong>band</strong></em> and <em>ID</em>=&quot;21&quot;.</li>
  <li>Code located in <code>functions.php</code></li>
  <li>Result: It would echo static text but would not display any post-specific content (Band Name, etc.). Also would not pull post-specific custom field data.</li>
  <li>(also tried <code>query_post</code> with no luck)</li>
  </ul>
  </li>
  <li><p>Custom Field</p>
  <ul>
  <li>Entered ID (21) into custom field on post editor page.</li>
  <li>Coded it directly into the post template:
  <ul>
  <li>Used <code>WP_Query</code> and had the <code>ID</code> in the array pull from the custom field.</li>
  </ul>
  </li>
  <li>Result: Nothing good happened.</li>
  </ul>
  </li>
  </ol>
  <h3>Where I Keep Running Into Trouble:</h3>
  <ul>
  <li>It's hard to pull the custom field data from the custom post type while inside an actual post</li>
  </ul>
  <h3>The Optimal Solution:</h3>
  <p>Whether it's by using a shortcode, custom field, or even a new widget, it would be easiest if one could:</p>
  <ol>
  <li>Create a PHP template with the code for just how the single <em><strong>Band</strong></em> content is supposed to display. (Including the loop). Example name: <em>band-block.php</em></li>
  <li>Use <code>get_template_part('band-block');</code> to echo this code (either in Post Template or Shortcode via <em>functions.php</em>)</li>
  </ol>
  <p>Thanks for your help! Let me know if you'd like to see any of my code.</p>