Grow your CSS skills. Land your dream job.

WordPress Pages – Where is the code?

  • # May 28, 2009 at 3:04 am

    Hey first off I’d like to say that Chris your wordpress tutorials were great.
    However I have a question regarding editing your wordpress pages that you create.

    I am aware of the Pages.php file which you can edit, and that’s all fine and dandy, but I am confused about where the content I put into these pages are located so that I can edited them without having to be logged in as the admin with wordpress.
    Its very frustrating that it wasn’t addressed in the videos.

    One might say "whats wrong with editing the html in wordpress?". Well editing the text in there is slow, and lacks code colour coding.
    But the biggest annoyance is all the random <p> tags put all over my code in the post.

    If someone could help me out with this I would really appreciate it as I want to get my blog fully functional :)

    Thanks.

    # May 28, 2009 at 3:41 am

    I think you are missing the point of what wordpress, or any cms, is. The content lives in the database, it is served up and placed in the page template on demand. Of course you can only edit your content through the admin panel, that’s why it’s called a Content Management System.

    # May 28, 2009 at 3:54 am

    *ditto*

    And I’ll add that WordPress will automatically turn two "returns" into a new paragraph. If you don’t want a new paragraph, than keep it on the same (or next) line.

    # May 28, 2009 at 7:42 am

    If you are having problems with WordPress adding <p> tags where you don’t want them you can add the following to your theme’s function.php

    Code:
    remove_filter(‘the_content’, ‘wpautop’);
    # May 28, 2009 at 2:15 pm

    Thanks for that davesgonebananas, that did the trick for removing those annoying <p> tags, just mention putting the php tags around it, I was smart enough to do so, but others maybe not.

    "apostrophe" wrote:
    I think you are missing the point of what wordpress, or any cms, is. The content lives in the database, it is served up and placed in the page template on demand. Of course you can only edit your content through the admin panel, that’s why it’s called a Content Management System.

    I don’t need a metaphorical explanation of how my content gets posted. I want to know where it goes and is stored literally.
    The reason I wanted to know this is if I could edit the html that I post from within WordPress outside of wordpress. Also out of curiosity I would like to know how wordpress stores the information I post.

    I have seen people write a php file with all the code they need and their main page and then use it as a template when they make a new page within WordPress.
    I think this is close to what I wanted to be done. This allows me to edit the php file in the program of my choosing, and then just have the new post call upon that template.

    # May 28, 2009 at 2:50 pm
    Quote:
    I don’t need a metaphorical explanation of how my content gets posted. I want to know where it goes and is stored literally.

    Well actually it seems like you do. No you can’t edit the content you post within WordPress outside of WordPress that is the whole point of WordPress. The information you post is stored in tables in the database.
    You said in your original post you knew about page.php, now you say you don’t. Are we talking about pages or posts? They are two completely different things.
    I suggest you start here http://blog.themeforest.net/screencasts/new-wp-video-series-and-free-rockstar-book/

    # May 28, 2009 at 3:35 pm

    You explained what I wanted to know :) "The information you post is stored in tables in the database."

    When I refer to pages, I’m talking about the creation of pages within WordPress admin, which calls on the page.php file.
    The content of that being: <?php the_content(‘<p class="serif">Read the rest of this page &raquo;</p>’); ?>
    I want to know if there is a way I can make my own php file which then gets uploaded as the the_content.

    I have read about using templates, but I don’t see anything about templates in wordpress 2.7.1… do you need to make a template for it to give you the option to use one?

    # May 28, 2009 at 3:52 pm

    Oh you mean you want to create page templates. If you create a php file in your theme directory and call it mytemplate.php (you can name it anything you like as long as it’s not a built in wordpress file) then start the file with:

    Code:
    < ?php
    /*
    Template Name: My Custom Template
    */
    ?>

    Then you can edit a page, say the About page, and you will be able to set the template to ‘My Custom Template’.

    Cheers
    Dave

    # May 28, 2009 at 4:00 pm
    "davesgonebananas" wrote:
    Oh you mean you want to create page templates. If you create a php file in your theme directory and call it mytemplate.php (you can name it anything you like as long as it’s not a built in wordpress file) then start the file with:

    Code:
    < ?php
    /*
    Template Name: My Custom Template
    */
    ?>

    Then you can edit a page, say the About page, and you will be able to set the template to ‘My Custom Template’.

    Cheers
    Dave

    Thank you a million times! Figuring this out made my life much easier haha. Thanks to everyone who replied :D
    Best.

    # May 28, 2009 at 10:42 pm
    Quote:
    When I refer to pages, I’m talking about the creation of pages within WordPress admin, which calls on the page.php file.
    The content of that being: <?php the_content(‘<p class="serif">Read the rest of this page &raquo;</p>’); ?>
    I want to know if there is a way I can make my own php file which then gets uploaded as the the_content.

    It looks to me like you are talking about posts not pages. Posts are served up by index.php and single.php not page.php.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".