WordPress.org

Ready to get started?Download WordPress

Forums

switching php code between pages, a tricky situation (4 posts)

  1. veevee
    Member
    Posted 6 years ago #

    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.

    http://www.kevinquinnmcguinness.com/dev/wp/
    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.

  2. moshu
    Member
    Posted 6 years ago #

    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...

  3. veevee
    Member
    Posted 6 years ago #

    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.

  4. RosieMBanks
    Member
    Posted 6 years ago #

    Go back to:

    Dashboard-->Options-->Reading-->

    ...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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.