Create SINGLE.PHP file and Show your Website’s Content
If your website’s content not show so now create single.php file in your Custom WordPress theme’s folder, then show uploaded or created/published post content.
How to do
- First of all open active theme’s folder.
- Then create single.php file and paste given code there then SAVE.
Code –
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package TheKroyaardSPL
*/
get_header();
?>
<div class="single-main">
<?php
if (have_posts()) {
the_post();?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1> <?php the_title() ?> </h1>
</header>
<?php
the_content();
?>
</article>
<?php } ?>
</div>
<?php
get_footer();
Watch Video
| Language | Hindi |
| Owner | TheKroyaard COM |
| Country | India |
Hope this code work fine in your custom theme, Have another doubt so contact us, Thank You
