Okay, so I’m putting some finishing touches on my content-single template and can’t seem to get it to behave properly.
I want the featured image to show at the top above the blog post on any regular post and for my custom post type Podcasts I want the podcast player to show in place of a featured image.
I would recommend creating another content file for your podcasts CPT. That way, you don’t have to use all those ifs which may be causing the issue?
So you can create a content-podcast.php file, copy the contents of the content-single.php file, and edit it accordingly to how you want to show the podcasts post. Then you can edit the content-single.php file as well to how you want standard single posts to show. Will that do?
Thanks. I’ve tried that. When I create a content-podcast.php file it doesn’t affect the podcast single display. I’m not sure if there is a setting somewhere or something… but doesn’t seem to matter what I name the file, where I put it, or anything. The only file I can get to adjust the content of the Podcast custom post type is that content-single.php file.
Oh… and if I name it ‘single-podcast’ I can get it to affect the page… but all that shows up is the content of the post… the rest of the theme is missing.
Do you mind sharing temp admin access so we can check? I’ll just have you know though this is beyond our scope of support. I’d just like to check, and possibly refer this to the guys, just in case it’s something simple we just missed.
Sorry, I think I figured out the issue. You’ll have to create a single-podcast.php file first. Then copy the files inside the single.php file, then change the part where it says <?php get_template_part(‘content’, ‘single’); ?> to <?php get_template_part(‘content’, ‘podcast’); ?>. Then just leave the content-podcast.php file like you want it. See if that works.
Okay, sweet. That works beautifully for the single view of the podcast custom post type. Thanks for the help with that btw.
I have one more question on this… the archive view of the podcast custom post type.
If I understand… I’d follow the same steps.
Make archive-podcast.php file. Copy in the contents of index.php.
Make content-podcast_archive.php file (for the template part referenced in the archive-podcast.php file above). Copy in the contents of the content.php file. Adjust as necessary.
On line 5 of the content.php file (the one I have now customized and called content-podcast_archive.php and am using as the archive template part for my podcast custom post type)… there is this code:
Wow. That was easy. The single quotes totally work.
Btw - for those who are interested in actually adding their own customizer panels & controls for this instance. I got the code to work for that.
Still have no idea how to actually call the setting (meaning I don’t know what I’d write on line five to get the setting to pull into that template part).