single.php is used unless there’s a single-cpt.php (where ‘cpt’ is the slug for the post type).
Don’t directly edit your theme; all PHP work should be done in a child theme.
]]>The beginning of my current single.php code is:
<?php get_header(); ?>
<div id="content">
<?php while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post-single'); ?>>
<h1 class="post-title-single entry-title"><?php the_title(); ?></h1>
<?php get_template_part( 'content-postmeta' ); ?>
<div class="entry-content">
<?php the_content(); ?>
My “new” post slug is “urlpost”
so If I copy this single.php I can have one called single-urlslug.php and when I use that custom post it will look for and find it? and if it doesn’t it will use the single.php?
As long as I have that new file in my child theme?
Or am I missing something? I’m probably trying to simplify something that is a bit more complicated – but that is how I begin to understand.
Thanks.
]]>