WordPress.org

Forums

New page? (23 posts)

  1. bang
    Member
    Posted 10 years ago #

    I'm trying to create a new page. What I want to do is duplicate the main page of my blog, and on the duplicated page, instead of having the blog entries, it will have just static text. I still want it to have the sidebars and all (footer.php in my theme) and the header and everything, I just want it to not show the blog entries and instead show static text that I can edit inside of WP.

    I have tried duplicated index.php and that has not worked, nor has duplicated pretty much every other page. There must be something that needs to be done otherwise.

    Hope this is not too confusing. :)
    Check out this example: http://tinyurl.com/67xx2

    Thanks

  2. eridan
    Member
    Posted 10 years ago #

    That's easy. Just use the Theme Editor which can be found under Presentation.

    Then edit your page template, and make sure there is a < ?php get_sidebar(); ?> and < ?php get_footer(); ?> and the end. In case you don't want that on all of your pages, just put an if at the end. Something Like if( is_page('pagename') { include the things }

  3. oriecat
    Member
    Posted 10 years ago #

    Did you go into Write Pages and add your static content? And it didn't work? Or are you just trying to create a page template?

  4. bang
    Member
    Posted 10 years ago #

    Thank you both for your replies.

    Oriecat: Once I get the main blog page sucesfully duplicated, then I can add my static content in the WP admin easily. The problem is getting a page duplicated (or making a new one that looks just like the index).

    Eridan: I made a new page, test.php, and inside that file I put all the php calls to include the header, sidebar and footer. Where would I put this file? I have the feeling that if I put it into 'domain.com/test.php' it will not work, and if i put it in 'domain.com/wp-content/themes/theme/test.php' i'm not sure if it will work either.
    I will try it. Thanks

  5. eridan
    Member
    Posted 10 years ago #

    What I ment was that first you create a page using Write -> Write Page (using wp-admin), after that you edit the Page Template (Presentation -> Theme Editor) and add get_footer and stuff there.

  6. bang
    Member
    Posted 10 years ago #

    Edit: Misunderstood

  7. bang
    Member
    Posted 10 years ago #

    Eridan: I didn't even notice that function in WP. Very useful.
    It automatically shows "posted by:" and a place for comments as well, though. Is there a way to not have it show posted by, and the comments area, and just show whatever I wrote in the text area to build the page?
    I am guessing I could do this in presentation>theme editor, but the page I created does not show up there for some reason.

    Thanks a lot for the help.

  8. moshu
    Member
    Posted 10 years ago #

    eridan likes to go the other way around :)
    The normal steps are: make a page.php = Page template; it can be a save as for index.php of your theme; delete all the tags that you don't need (date, category etc.)... you can even repeat this process 10 times giving different template names to the new files - and at the end you'll have 10 different Page templates :)
    Then go to write Pages > and select the desired Template from the drop-down menu.
    For an overhaul of a template I wouldn't use the built-in editor, that's just for minor corrections, IMHO. (or not H!)
    Work in a text editor.

  9. desemweb
    Member
    Posted 10 years ago #

    See the "Page to Front" plugin at http://codex.wordpress.org/Pages (under "WordPress as a CMS"). Will that do what you're trying to do? I got it to make a Page the home page of the blog site.

    Lois

  10. moshu
    Member
    Posted 10 years ago #

    desemweb, the OP never said anything about wanting a Page as homepage. It was just about creating/writing Pages. What was described in the first post was "how to create a page template that looks like my index.php but has 'static' [what a misnomer] content - i.e. I can put content in through the Write Page feature".
    So, I just answered THAT question above.

  11. desemweb
    Member
    Posted 10 years ago #

    Moshu, I wasn't sure from the first post. It sounded to me like the OP wanted a home page that looked like the rest of the blog but had static content rather than blog entries, so I suggested one way to do that.

    Our previous posts were posted 5 seconds apart, so I hadn't seen your previous post anyway.

    Lois

  12. oriecat
    Member
    Posted 10 years ago #

    Question on all this - if you write a page and do not have a page template, it will still use the Main template, correct? That's why I think eridan and I were trying to see if bang had even created a page yet. Until you have a page made and see how it looks, then you can see what you want to edit out, if anything. If you don't want to edit anything out, you wouldn't need a page template. Right? Or am I misunderstanding something?

  13. skeltoac
    Member
    Posted 10 years ago #

    Bang, let's clear up exactly what your intentions are. Do you want this special page to be your home page, always displaying the same text? Be very specific.

  14. bang
    Member
    Posted 10 years ago #

    That feature eridan showed me is perfect. I want it exactly like that but without the 'posted by:' 'comments' etc etc
    Like I said, I assume I could do this in presentation>editor but the page I created is not in there....is it supposed to be?

    To make it clear and as simple as possible, what I want is exactly what eridan showed me, but without there being 'posted by' etc - I just want it completely blank except for the text i posted in the new page.

  15. moshu
    Member
    Posted 10 years ago #

    Quod erat demonstrandum: s/he needs a Page template :)

  16. moshu
    Member
    Posted 10 years ago #

    @oriecat >
    Yes, if there is no page template, the Main (a.k.a. index.php) will be used. See Template Hierarchy in the Codex. For those with a visual mindset: a visual anatomy of the template system.

  17. bang
    Member
    Posted 10 years ago #

    Do you mean when I create the page (write>write page), I select a "Page Parent" and it will use that template?
    I'm lost.

    I could edit the page in a text editor and get rid of the unnecessary stuff i don't like, but the url to the page is "site.com/?page_id=5" so i don't know the actual php file to edit to effect "page 5".

  18. oriecat
    Member
    Posted 10 years ago #

    What you need to do is copy everything in the Main template (aka index.php). Then paste it into a new document and name it page.php. Then delete out the portions you don't want, such as the comments tag and the author tag, etc. Then upload that page.php into the theme you are using.

  19. bang
    Member
    Posted 10 years ago #

    Oriecat: I just did that, and tried to load up the page to preview how it looked (I didn't edit anything, just renamed it) and I get this:

    Fatal error: Call to undefined function: get_header() in /home/***/public_html/***/wp-content/themes/theme/page.php on line 1

    Of course, line 1 is "<*?php get_header(); ?*>"

  20. moshu
    Member
    Posted 10 years ago #

    Nobody ever reads the Codex???
    What you made (page.php) is a template = empty skeleton file of your future Pages.
    You cannot see "how does it look", you have to put content in it. Go and Write a Page, then look at THAT, not at the empty template.

  21. bang
    Member
    Posted 10 years ago #

    Ok. So how would I go about connecting a page I write in write>write page to the template I just made?
    I saw nothing about what i'm trying to do in Codex.

    Sorry, but I still don't see where you are going with this. I see the way I would manipulate the output on the page I duplicated, but I do not know how to tie the template I just made with a page I write from Write>Write Page.

  22. moshu
    Member
    Posted 10 years ago #

    That's when Codex comes handy :)
    If you have only one Page template (called page.php) WP recognizes its presence, and if you write a page (Write > Write Page) this page-template will be used to display it. Am I clear? Does this help?

    On the other hand if you decide to make more Page templates (again, see Pages in Codex - they need a few special lines at the top) then on the Write Page admin section you will have a drop down menu that offers the possibility of choosing one of templates for displaying the content you Write into the Page.

  23. bang
    Member
    Posted 10 years ago #

    It worked great. Thanks a lot moshu, and everyone else. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.