How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
I am trying to create a single.php file to be the default template for displaying single posts in a child theme that I have created from the TwentyTwentyThree theme. The reason I want to set this as the default is I have a lot of custom css used for the navbar that is a real pain to get working with the new editor, so I just want to create a single.php file that I can use to display the content as the default. Theoretically, due to the way the Wordpress template hierarchy is structured this should work, but when I create the single.php file within my directory it doesn't show up as an option in the sidebar.
When trying to edit from the wp-admin page it takes me to the new site editor and there is no option to add php and I can only edit the html template from the parts. This corresponds to the file highlighted in the image below.
The code required is rendered in my header.php file and works well for the page templates, like front-page.php or other custom templates which I have created but for some reason I can't get the same thing to work for the single posts Is there a way to do this?
Here is the code for the single.php file:
<?php
get_header();
?>
<article class='content px-3 py-5 p-md-5'>
<?php
if( have_posts() ){
while(have_posts()){
the_post();
the_content();
}
}
?>
</article>
<?php
get_footer();
?>
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand