WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress page is pulling post from main index page (9 posts)

  1. josiahmann
    Member
    Posted 11 months ago #

    I have a custom theme set up at glassgenesis.com with a static page as my home page. I have other separate pages that are correctly pulling the page info from my WordPress editor, but the "products" page pulls the post data from the home page- so basically I have two pages pulling the same data. I assume it has something to do with my page.php file but I don't know what I'm doing wrong. Any ideas?

  2. paulwpxp
    Font hero
    Posted 11 months ago #

    My first guess is that you set Page=Product as Static front page, is that right ?

    Also please consider putting body_class() into body tag.

    In header.php change this

    <body>

    to this

    <body <?php body_class(); ?>>
  3. josiahmann
    Member
    Posted 11 months ago #

    The static home page is set to "home", not products.

    I will try your suggestion when I get a chance at lunch.

  4. josiahmann
    Member
    Posted 11 months ago #

    Ok, I have changed the body to "<body <?php body_class(); ?>>". Still no luck.

  5. paulwpxp
    Font hero
    Posted 11 months ago #

    So on your front home, view source and see this

    <body class="home page page-id-2 page-template-default">

    On your Page=Products, view source, and also see the same thing.

    <body class="home page page-id-2 page-template-default">

    Conclusion is that the page-id-2 is set as static front home.

    On a separate note, the validator says there are 2 closing tags not properly closed.
    http://validator.w3.org/

  6. josiahmann
    Member
    Posted 11 months ago #

    Wow I didn't know about that validation tool- is it kind of an industry standard tool?

    The homepage is set to home- which doesn't have a name in my wp page. When i set it to products it loads properly. Then when I reset the front page to home, it temporarily works right before reverting...

  7. esmi
    Forum Moderator
    Posted 11 months ago #

    Have a read of Validating_a_Website.

  8. paulwpxp
    Font hero
    Posted 11 months ago #

    The homepage is set to home- which doesn't have a name in my wp page.

    You should put in the page name for Page set to home, don't leave it empty. Use a name that relates to your site for SEO purpose, and then put this in stylesheet.

    /* ----- hide title on home keeping SEO ----- */
    .home .entry-title {
    	position: absolute !important;
    	clip: rect(1px 1px 1px 1px); /* IE7 */
    	clip: rect(1px, 1px, 1px, 1px);
    }
    
    /* ----- just some adjustments ----- */
    .entry-content {
    	margin-top: 43px;
    }
  9. josiahmann
    Member
    Posted 11 months ago #

    Ok, apparently it is working now, but I'm not really sure what fixed it... Thanks for the help.

    Paulwpxp thanks for the tip, thats a great idea.

Reply

You must log in to post.

About this Topic