0

I'm following a tutorial on wordpress themes but I've noticed that my posts only appear on the "/localhost/wordpress/" domain and nowhere else, even though they should.

If for example I was to go to "/localhost/wordpress/about-us/" there is not a single post there whilst all the posts shown on "/localhost/wordpress/" should be visible here as well.

The error is not im my theme code, I am 100% sure of that. So my question is, what else can be the cause of this behaviour?

I do not use a static home page.

This is my page.php code

<?php

get_header();

if (have_posts()) :
    while (have_posts()) : the_post(); ?>

     <article class="post page">
         <h2><?php the_title(); ?></h2>
         <?php the_content(); ?>
     </article>

     <?php endwhile;

else :
    echo '<p>No content found</p>';

endif;

get_footer();

?>

This is my index.php code

<?php
get_header();

if (have_posts()) :
    while (have_posts()) : the_post(); ?>

    <article class="post">
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        <?php the_content(); ?>
    </article>

    <?php endwhile;

else :
    echo '<p>No content found</p>';

endif;

get_footer();
?>

1 Answer 1

0

Do you have a shortcode on the about us page or how do you output your posts ?

Posts only appear on your blog page by default.

Do you have a static home page ?

Need some more information here

1
  • I have added the extra information. There are no shortcodes involved as far as I'm aware. Oct 19, 2016 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.