WordPress.org

Ready to get started?Download WordPress

Forums

How to........make new pages (14 posts)

  1. SeanB
    Member
    Posted 9 years ago #

    I've been editing the index.php file so I can make other pages that match the rest of the site.

    http://sean.freesuperhost.com/about.php

    Say I have like 5 news pieces on the index.php file the text on the about.php page will be repeated 5 times. Anyone know how to fix this.

  2. zeroK
    Member
    Posted 9 years ago #

    Do you have this is a page (in wp1.5) or as a simple php file? It would also be helpful if you'd post the source code of this page :-)

  3. SeanB
    Member
    Posted 9 years ago #

    I don't understand what you mean by your first question, all I did was get the index.php file and edit it to make the text appear.

    Also you can view the source by going View>Source in your borwser :)

  4. To create a page in v1.5, go to "Write" and select "Write Page". The template is taken care of for you, all you have to enter is the page content.

  5. j0llyr0ger
    Member
    Posted 9 years ago #

    Yeah, and, you might be surprised to discover SeanB that when you view the source of the web page delivered to your browser it looks nothing like the php source code you see in the edit template window.

    Why? Because what you see in the edit template window is the php code that is used by the server to generate the web page on the fly.

    This concept is called 'dymanic content' and it is kind of hard for those who are new to it to grasp sometimes.

    Look at it this way- your templates are instructions the server uses to build the web page that is delivered to a browser. The template itself is never visible to people who view your site, viewers can only see the HTML generated based on the code in the template.

    To post a new entry, go to the 'Write' page and type your entry. Then click 'Publish' and it will appear on your index.php page.

  6. Whoa, Jolly, calm down there. It's a common misconception.

  7. j0llyr0ger
    Member
    Posted 9 years ago #

    It's cool- I'm calm. ;)

    Just trying to help a brother get up to speed.

    Did what I said help you SeanB?

  8. SeanB
    Member
    Posted 9 years ago #

    I know how to write posts, I want to make it as a seperate page though and not to appear on the index.php page. Heres the code from around the text.....

    <i><div id="rap">
    <h1 id="header">"><?php bloginfo('name'); ?></h1>

    <div id="content">
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>

    <?php the_date('','<h2>','</h2>'); ?>

    <h2>About</h2><br>

    This site was first made on 10th January 2005, starting with v 1.0 which was made with HTML.<br>
    I then moved onto v 2.0 which was made with Photoshop and Image Ready but looked crap and only lasted<br>
    for about a day. V 3.0 was also made with Photoshop and Image Ready but looked much better, that lasted for<br>
    about a month :P This version is v 4.0 and is made with Word Press, a blogging tool. Much easier to update<br>
    than the other sites.<br>

    This site is just for putting anything I want on it, if you want to ask something or give a suggestions e-mail me.
    </div>

    <?php endforeach; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    </div>
    </i>

  9. j0llyr0ger
    Member
    Posted 9 years ago #

    I'm not exactly clear on what you are trying to do.

    Do you want the version info to be on a separate page, with a link to it on the main page?

    If so, you can write a simple HTML page and use file upload (but you'll have to add html to the allowable file upload types in the options -> miscellaneous section) and then just put a link to it on your index.php but if you put a link on the index.php page (or if you want the version text to appear on the index.php page only once) you need to put the link or the text outside what is called the loop.

    The line
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    starts the loop which lists all the posts which should be seen on the index page and the line
    <?php endforeach; else: ?>
    ends the loop.

    Anything between those two lines will show up with each post so to make it appear only once, put it above the first line of the loop to show above the posts, or after the last line of the loop to be shown below the posts.

    Does that make sense?

    Sorry for sounding like a jerk in my first post.

  10. No no no, not posts, pages. To create a page in v1.5, go to "Write" and select "Write Page". The template is taken care of for you, all you have to enter is the page content. For an example, go to my site and look for "Pages" in the side bar. They have helped my clean up my sidebar content, but others use them to create about and contact pages.

    http://www.macmanx.com/wordpress/index.php

  11. SeanB
    Member
    Posted 9 years ago #

    Thanks both of you. MacManx you way works but like I said. I didn't want on the index.php page. Thanks for showing it out to me though.

    I'm gonna try what j0llyr0ger said......

  12. SeanB
    Member
    Posted 9 years ago #

    Done

    http://sean.freesuperhost.com/about.php

    Now to get the rest of my pages back online :)

    btw I'll give credit to you guys.

  13. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    I'm not clear on precisely what you mean by you "didn't want it on the index.php page", but the new Page feature of 1.5 is meant to accomplish exactly what you want to do without all the hassle of maintaining a bunch of other files.

    Plus, you get nice permalinks:
    http://www.example.com/about/
    instead of
    http://www.example.com/about.php

    For information on the feature:
    http://codex.wordpress.org/Pages

    For information about listing (or not listing) Pages on your site:
    http://codex.wordpress.org/Template_Tags/wp_list_pages

  14. SeanB
    Member
    Posted 9 years ago #

    Thanks but I've already got all the pages up now.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.