0
votes

I am new in Wordpress. I am developing my own theme. I have included index.php, functions.php, header.php, footer.php, page.php, style.css etc.. Now my home page is working perfectly. When I am going to display category menu its showing only header and footer. Not inside the content. When displaying post also its showing Header and footer.

What are the steps included for displaying posts in theme development or is there any function I want to include in function.php ?

4
please describe your question more ..Mayur Devmurari
I am converting html theme to wordpress.Now my homepage working perfectly,displaying posts also.But going to other menus(defined as post) showing header and footer not any content inside that..What i have to do for displaying content in each post.Iyrin
Thank you guys..Now its showing posts also.Iyrin
@lyrin you should select a correct answer and upvote answers that were helpful to you.jono

4 Answers

0
votes

Best way is to copy the existing theme and change the theme name ( make changes in css , images , header , footer design ) and use that , it will work correctly.

0
votes

If you are working with child theme. than all pages display under default template. and default template is page.php. for category there is a category.php or archive.php file in which you have to change code for more functions.

And for display post you have to change single.php

you can create template for additional functionality.

that's it.

0
votes

You might be missing content.php, category.php,content-single.php and many more files which in result not displaying your content part and only displaying header and footer.

Best way is download fresh word press from :

https://wordpress.org/download/

It will include all supporting files for load website.copy one of theme from fresh themes folder and replace it with your theme and customise in it.

0
votes

You need to use "the loop" to display the content from the page/post.

<?php get_header(); ?>
<?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
        <article>
            <header><h1><?php the_title();?></h1></header>
            <?php the_content(); ?>
        </article>
    <?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>

Copy this code into a new file called single.php in your theme folder.