[resolved] Stuck on making a custom template (7 posts)

  1. karenjwalker17
    Posted 9 years ago #

    Whew! This stuff is tough to a newbie! Ok, so I'm trying to add a timeline of my kids' milestones. I figured out that I needed a new page. I created one (Admin screen -> Create Page) but didn't like the look of it. My code was fine but the page included some things I didn't want like the date at the top and comments at the bottom. I read around and looked for a page.php template so I could modify it but my theme didn't have one. So where was the template WP was using for my new page!?

    Anyway, then I found the index.php file, copied it, deleted the middle stuff and put the template "Snarfer" stuff at the top (calling it timeline of course instead of Snarfer). Then I made another new page based on my new template, putting in the code I used before. When viewed, the header, sidebar, and footer pulled in fine. My table where I had laid out all my data however was absent(missing when I viewed source as well). If I go into the Admin screen and edit the page, my code is still there.

    What happened? I want the original template (the one I couldn't find) back but so I can edit it. Can someone send me in the right direction, please?

    Thanks to anyone who can answer me. Sorry it's probably such a stupid (long!) beginners' question.

  2. moshu
    Posted 9 years ago #

    One possible cause: if you are putting in your own code - never use the wysiwyg editor!

  3. karenjwalker17
    Posted 9 years ago #

    Ummm...To input the HTML code I use the HTML button at the top of the WYSIWYG editor. Also my code is a huge table. I don't know how else to lay out something into two columns. Could that be the problem?

  4. vkaryl
    Posted 9 years ago #

    The wysiwyg strips your code, so yes, that's a problem. You'll need to disable the wysiwyg (your profile page in wp-admin/users, scroll to the bottom, uncheck the box on the left).

  5. Michael Bishop

    Posted 9 years ago #

    Sounds like you stripped the Loop out of the page template, thereby the Page's data is not being pulled in.

  6. karenjwalker17
    Posted 9 years ago #

    Thanks for all your help. So great to know how to turn off the WYSIWYG. I don't think we've quite hit on the problem yet though. After I made the new page the first time, I used the same process to input my table of code and it showed up just fine. The only problem was that the template included some things I wanted to get rid of.

    The files in my theme folder are:
    timeline.php - The one I created which isn't working.

    When I created a new page, where did it get the template from? It showed the title of page, the date of the posted, posted by, and comments, so it obviously wasn't a blank page. That is what is vexing me.

    Although I guess you all are right that I just could fix my template.php file. It just feels like it'd be so much longer...

  7. karenjwalker17
    Posted 9 years ago #

    Woohoo! I fixed it. I looked into what you meant by taking out the php loop. I thought it didn't matter, that I was hardcoding the page. But now I see that isn't true. I bet it was using index.php as my default page template. I copied it and took out the parts I didn't want. Don't know for sure what everything is there for but I'm so thankful for your help!

Topic Closed

This topic has been closed to new replies.

About this Topic