Support » Fixing WordPress » switching php code between pages, a tricky situation

  • Hi, I have a site that is very close to being complete. All of the code is working, but I didn’t do the best job of planning. I want to switch the content that appears for index.php with the content that appears when pages.php is called. I only have one Page, so I figured, I’ll just switch the code. When I do switch the code, all of the content on the index appears, oh, about 42 times, and nothing appears on my Page (I only have one) except the static content. I guess my question is how is wordpress treating the php I have on my index.php differently from the code i have on pages.php?

    This is tricky for me, I have a whole bunch of custom snippets calling recent posts onto my Page, and calling links to every post on the index. I’ll post a link, but it might not be that helpful, I think i just need to intensively debug my php.
    So I changed the code back to the functioning stage. What appears on the landing page, is what i want to appear when the Map link is clicked. And what appears now when the Map link is clicked is what I want to be the index. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1. There is no pages.php
    2. Read. Pages are not for displaying posts.
    3. Never mix Pages and posts.

    4.Don’t ask “technical how-to” questions – since you don’t know what to ask.
    Just describe in plain English WHAT you want to achieve (the end goal) and we will tell you the HOW.

    MOst of all, study your own admin interface

    Oh, you’re right, it’s called “page.php” sorry for the confusion. So I have a landing page. It appears at the root of my wordpress site. I also have a Page called ‘map’. I want the content that appears on the landing page now to appear on the ‘map’ page, and the content that appears on the map page to appear on the landing page.

    I know about using a Page as the front page, but that only solves half of the problem. Once I set my ‘map’ page to be the front page, I still need a way to display the content that’s called by index.php.

    Go back to:


    …it’s the same place where you’ve set up your static page, only now you go to the toggle menu that says “Posts Page”.

    Hit the toggle and find the “map” page, select it and save it. That page is now where the your blog posts will go (the stuff that was normally found on index.php).

    Is that what you were trying to do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘switching php code between pages, a tricky situation’ is closed to new replies.