• Hi,

    I’m quite new to Worpress. I just learned how to set up static page and page template etc. I was a little surprised first to learn that the page is always blank. You do all your design in the template.
    However I’m very doubtful this is right. If there a way for a page template to read text from a page, we can keep data in pages. Do you think this blank page concept in my head is the right?

    My immediate task is to write a landing page. I know I should follow the WordPress features such as plugins and sidebars etc but the learning curve is stiff. I’m thinking do everything ia a template such that I can place each article in rectangle block with bordrs. I can menu bars here and there etc. I would feel right at home first as a experienced PHP/HTML programmer. Can I get your opinions on this approach?

    Warren

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can you elaborate a little more please.

    Thread Starter jaguarx

    (@jaguarx)

    t3los_:

    I need to get a landing page done badly. At first I was going to use PHP/HTML to make it. Later on I ran into WordPress and decided to switch to WordPress. I created a static page and made a page template for it. Basically I have a blank static page with a page template. Rignt or wrong, I have the template hold all the text and graphics in it. The landing page is up and running now but the blank page approach bothers me. I need experienced users tell me if the blank page proach is the most common way. If not, what is?

    Thanks,

    Warren

    You’re still not being very clear about what you mean by the blank page approach…

    If you’re referring to the page that you’re attaching the template to being blank, it’s just a placeholder so to speak. In order for that page to have a URL and a permalink it must exist in the database, a template can’t do anything on it’s own, it must be attached to a page, whether that page has content or not doesn’t matter if you’re putting content into the attached template.

    Thread Starter jaguarx

    (@jaguarx)

    t3los_,

    Sorry about the blank page. Yes, I mean the page attaching to a page template having no content. While I understand the place holder role it plays, I have questions to that effect:

    1. Is it the most common practice to keep attaching pages blank?
    2. Is there a way to display the content of an attaching page?

    Thanks,

    You can still include the content for the page yes, just use a regular loop like you would elsewhere.

    Makes sense for this approach yes, if you don’t want to keep creating and attaching pages then perhaps you need to re-think whatever it is you’re using Page Templates to archive.

    Conditional statements could be used if you’re just including small amounts of data in the templates..

    <?php if(is_page('somepage')) {
    include( TEMPLATEPATH . '/yourcode.php')
    } ?>

    Of if you wanted to be a little more flashy you could include a file_exists check to see if a file with the same name as the page exists, and if it does, then include it…

    It really depends what is it you’re putting into these templates and why, there could be many others way to do the same thing.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can A Page Template Read a Page?’ is closed to new replies.