Grow your CSS skills. Land your dream job.

Single post on page?

  • # January 14, 2009 at 4:01 pm
    "LinCSS25" wrote:
    yes that is it! front page shows the most recent post. they are calling it news.. Im not sure i will call it that, prob just most recent blog post. then a page that shows all the blog posts.. or however many you set to show on a page.

    ok here is what I done:

    made my site without wordpress, then I added wordpress to a directory and called that blog.

    made the "news " link a href="http://www.woskf.co.uk/blog/" that links straight into my posts part of wordpress and I set wordpress to show posts as first page, not a static page.
    so to access wordpress’ content, you would have to click the "news" link to take you to the wordpress index.php. I set my wordpress to show only the 5 most recent posts, but the main home page will only show the most recent snippet

    but I wanted to add an excerpt of the post in my main home page so I added some php code.

    At the very top and very first thing in the hompages php file I added:

    Code:
    < ?php
    // Include WordPress
    define('WP_USE_THEMES', false);
    require('/home/fhlinux139/w/woskf.co.uk/user/htdocs/blog/wp-blog-header.php');
    query_posts('showposts=1');
    ?>

    now my require will not be the same as your as it is for my site just link into your wp-blog-header.php

    then where I wanted the excerpt to be shown I put this piece of php code:

    Code:

    < ?php while (have_posts()): the_post(); ?>

    < ?php the_title(); ?>

    < ?php the_excerpt(); ?>

    ” class=”red”>Read more…

    < ?php endwhile; ?>

    edit: if you wanted the full post on your static homepage, change the code: the_excerpt(); for the_post();

    then once that page was uploaded, I had wordpress the way I wanted it, within its own directory, but linking into it

    I hope that is all clear now, any probs just shout

    # January 14, 2009 at 4:16 pm

    So when you made all your other pages that are not WP pages.. are they just html files? How do you get the blog and the rest of the site to match? I mean.. I know you can do the same CCS sheet I guess but Im confused because I guess the coding for WP is different in that its broken up into the header, sidebar, bla bla within PHP files.. and regular static pages arent. right?

    # January 14, 2009 at 4:25 pm
    "LinCSS25" wrote:
    So when you made all your other pages that are not WP pages.. are they just html files? How do you get the blog and the rest of the site to match? I mean.. I know you can do the same CCS sheet I guess but Im confused because I guess the coding for WP is different in that its broken up into the header, sidebar, bla bla within PHP files.. and regular static pages arent. right?

    any chance I could chat to you on msn? this might take longer doing it on this forum, after that you can delet my username from msn?

    # January 14, 2009 at 4:31 pm

    LKellis25

    # January 14, 2009 at 4:34 pm

    Ok nevermind I do.. I forgot I had an old hotmail account. Im on there now. its LKellis25

    # January 14, 2009 at 4:41 pm
    "LinCSS25" wrote:
    I dont have an MSN account. I have AIM. do you? thank you so much for trying to help me, you are so kind.

    sorry I dont have aim…..

    ok we will do this the long way.

    you have got your wordpress working, so you got your index.php working.

    take out the php code within your header, main, sidebar & footer, cut all the html code from all of those files into one file and then save that as anything_you_like.php but outwith wordpress
    and use the wordpress CSS file to style it, so you may have to make the link different when not in wordpress.

    now that you have a blank page to add your content to, and this will look the exact same as wordpress, the only difference is, it is not stored in the wordpress directory.

    that way you can add what you want as a home page.

    Now add the snippets of code I told you about earlier, and put the first one as the very first thing that is seen in the file, and add the other bit of code anywhere else you want it to appear.

    Remember my wordpress is in its own directory, and my home page is in the root directory.

    does that make sense?

    what index.php in wordpress does is just pull together the header, sidebar, main & footer into one file.

    EDIT: I said Cut code, I meant copy code, don’t kill your wordpress files

    # January 14, 2009 at 6:48 pm

    Ok I got what you have said so far.

    Now for the page that I do want to show the whole blog.. what do I link that too? will it be the index file for WP?

    Ill start pluggin away at this and Im sure it will come together.

    Dunno if you saw my revised message but I do have MSN.

    # January 14, 2009 at 7:06 pm

    wait.. if I take out the PHP.. wont some of the functionality be lost?

    # January 14, 2009 at 10:17 pm

    So I had posted in the WordPress forum the same time I did here for my search for how to do this and someone gave me this link

    http://moshublog.com/2007/09/10/static- … c-content/

    I tried this and it seems to work well so far.

    Thank you so much for the time you spent to share you method too. I thought Id share this finding as well.

    # January 15, 2009 at 2:05 am
    "LinCSS25" wrote:
    Ok I got what you have said so far.

    Now for the page that I do want to show the whole blog.. what do I link that too? will it be the index file for WP?

    Ill start pluggin away at this and Im sure it will come together.

    Dunno if you saw my revised message but I do have MSN.

    I tried to link you into msn but it does not work with just the username, I would have needed the rest like @hotmail.com or something.

    any glad you are getting it sorted.

Viewing 10 posts - 16 through 25 (of 25 total)

You must be logged in to reply to this topic.

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