Grow your CSS skills. Land your dream job.

WordPress posts showing up in all pages, why?

  • # February 6, 2012 at 1:21 am

    I was just going through the theme I’m building and noticed that the pages I made aren’t showing the content posted in that page, all that shows up are the posts that are created. How come it’s doing this and how do I get the content from the page to show up instead of the posts?

    # February 6, 2012 at 2:17 pm

    Please post the code you have in your page.php

    # February 6, 2012 at 2:54 pm

    sorry, reposted the code so it will show properly

    # February 6, 2012 at 2:55 pm
    < ?php get_header(); ?>

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




    < ?php the_title(); ?>


    < ?php the_content(''); ?>
    < !
    End Of Content_Main
    >

    < !
    End Of Content_Wrap ---->


    < ?php endwhile; ?>
    < ?php endelse: ?>
    < ?php endif; ?>

    < ?php get_footer(); ?>
    # February 6, 2012 at 3:18 pm

    Hmmmm, nothing looks out of order for me there. Try replacing the_title with some random text. This will make sure that your pages are using the proper template.

    # February 6, 2012 at 3:27 pm

    maybe I’ll just remake it from scratch. I’m using Ambers hijinks wordpress template.

    # May 7, 2012 at 4:09 am

    Hi, thanks in advance for any help. I’m having this same problem. My posts are showing up on all pages when I want them to show up only on the home page. I’ve designated “latest posts” for “front page displays” in settings>reading but the content from my pages doesn’t show up, the one blog post shows up on all pages. Any ideas how to fix?

    Here is the link to a page; http://hollyraschein.com/wordpress/about/
    Here is the code from my page.php;
    < ?php
    /*
    Template Name: Page
    */
    ?>
    < ?php get_header(); ?>
    < ?php get_sidebar(); ?>

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

    < ?php the_content(); ?>
    < ?php wp_link_pages(array('before' => ‘Pages: ‘, ‘next_or_number’ => ‘number’)); ?>

    < ?php edit_post_link('Edit this entry.', '

    ‘, ‘‘); ?>

    < ?php endwhile; endif; ?>

    < ?php get_footer(); ?>

# May 7, 2012 at 4:10 am

h

# May 7, 2012 at 4:14 am

ugh, i can’t even copy and paste my code here for some reason, its copying tweaky…guess its time for bed.

# May 7, 2012 at 4:18 am

ok one last try…
< ?php
/*
Template Name: Page
*/
?>

< ?php get_header(); ?>

< ?php get_sidebar(); ?>

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

< ?php the_content(); ?>

< ?php wp_link_pages(array('before' => ‘Pages: ‘, ‘next_or_number’ => ‘number’)); ?>

< ?php edit_post_link('Edit this entry.', '

‘, ‘‘); ?>

< ?php endwhile; endif; ?>

< ?php get_footer(); ?>

# May 7, 2012 at 9:40 am

In my main index template(index.php) I had this where I wanted my posts to appear.


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

< ?php the_title(''); ?>


< ?php the_content(''); ?>
< ?php endwhile; endif; ?>

That fixed everything for me, so my posts would show up on my main home page and then on my pages it would show the page content I had.

Don’t forget to place it in your page.php template also. Let me know if it works.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".