Can anyone share with me how to set up my home page so that it only shows one post of my blog (the most recent post) with a continue reading link... What code to I change to do that? What I want is to have ONLY the most recent post on my home page then have a link in the navigation for Blog.. then that page would show the whole blog list.. however many post I allow to be shown on a page. Does that make sense?
So I guess I need to know how to do both. how to I make another page show the whole blog rather than the home page, but have the home page show just one most recent post.
as an example I kind of like how this guy set his up, he put the rest of his posts in an archive.
ya know.. Im working hard to learn wordpress to use as the CMS of my portfolio/design business site. I wanted to learn it so things were easily changed, updated.. etc but what do i do? I keep looking for the hard way to do things when what I want and am looking or is right under my nose in the WP admin panel.
Im used to learning all the hard stuff now I need to realize that some of it is now just the easy stuff that WP will do it for me.
Im still unsure of how to have one post on my home page.. and then all, or atlest more than 1 displayed on my blog page... hmmmm. I could keep my home page as my post page and set it to show one , but then how would I get my blog page to show an archive or, 5+ of my post..
Or I could set my blog page to show posts, but then how do I get a section that shows only my most recent post. The setting in WP allows me to only do part. from what I can tell.
make your home page a static page, or a page in wordpress;
ok in your index.php page, start the code with:
<?php // Include Wordpress define('WP_USE_THEMES', false); require('/address-to-your-header-is-different-to-mine/wp-blog-header.php'); query_posts('showposts=1'); ?>
then wherever you want your excerpt of the most recent post put this piece of PHP:
<!-- mini loop for the excerpts --> <?php while (have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <p><a href=\"<?php the_permalink(); ?>\" class=\"text1\">Read more...</a></p> <?php endwhile; ?> <!-- end the mini loop -->
edit: i believe you can change the_excerpt() to the_post() if you want the full post on that page
but on your blog page make as many posts visible as you like.
mind you this is only an excerpt check out what it should look like with the "update on pfs" under News heading in this link: http://www.pfs-ifa.co.uk/index.php
hmmmm thats not quite working. but maybe Im doing it wrong. I want the home page to have the snippet of one/most recent post, and the blog page to have the whole blog.. so if I read your instructions right that had me putting both sets of code you gave in the index.php file..
hmmmm thats not quite working. but maybe Im doing it wrong. I want the home page to have the snippet of one/most recent post, and the blog page to have the whole blog.. so if I read your instructions right that had me putting both sets of code you gave in the index.php file..
I tried other combinations too but no luck.
no sorry my bad for not explaining fully.
I have a site that has index.php and that is static, not wordpress' index.php, that has the snippets of code I gave. I could have made this home.php but it has to be a php file.
my blog/wordpress is in a directory called resources, so really my index.php is not in wordpress, but I would take it the mini loop could be put into any page through wordpress. I can see why you are confused. in the resources/wordpress directory there is another index.php but only for that directory (wordpress' index.php)
edit: go to that site I linked to the pfs one, and click on the links at the very top, then look at your address bar, they are all index.php files in that site
How do I get WP to recongize the new Home.php file I made so I can set it as static under settings? It seems to only show Pages I made through it as options to choose from.
Can anyone just step me through how to do this? Im failing big time. missing something. How do I set a static home page (where does it need to be in my server directory), where do I put what code, and what setting do I set up in the admin panel?
How do I get WP to recongize the new Home.php file I made so I can set it as static under settings? It seems to only show Pages I made through it as options to choose from.
Can anyone just step me through how to do this? Im failing big time. missing something. How do I set a static home page (where does it need to be in my server directory), where do I put what code, and what setting do I set up in the admin panel?
right.. do you think I should have it in its own for what Im wanting to do?
from the full thread, I think your wanting a static home page then be able to link into wordpress.
I would.
I added wordpress 2.7 to my kung fu site. I put wordpress into a directory called blog.
but my home page links into it.
I know earlier you got confused about my index.php example, but what I was trying to show you there was that you can still access the wordpress loop from outside the wordpress directory.
see if this is what your looking to achieve linking wise: www.woskf.co.uk
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.
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:
<?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:
<!-- mini loop for the excerpts --> <?php while (have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_excerpt(); ?> <p><a href=\"<?php the_permalink(); ?>\" class=\"red\">Read more...</a></p> <?php endwhile; ?> <!-- end the mini loop -->
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
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?
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?
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
So I guess I need to know how to do both. how to I make another page show the whole blog rather than the home page, but have the home page show just one most recent post.
as an example I kind of like how this guy set his up, he put the rest of his posts in an archive.
Thanks
ya know.. Im working hard to learn wordpress to use as the CMS of my portfolio/design business site. I wanted to learn it so things were easily changed, updated.. etc but what do i do? I keep looking for the hard way to do things when what I want and am looking or is right under my nose in the WP admin panel.
Im used to learning all the hard stuff now I need to realize that some of it is now just the easy stuff that WP will do it for me.
Thanks Chris
Or I could set my blog page to show posts, but then how do I get a section that shows only my most recent post. The setting in WP allows me to only do part. from what I can tell.
make your home page a static page, or a page in wordpress;
ok in your index.php page, start the code with:
then wherever you want your excerpt of the most recent post put this piece of PHP:
edit: i believe you can change the_excerpt() to the_post() if you want the full post on that page
but on your blog page make as many posts visible as you like.
mind you this is only an excerpt check out what it should look like with the "update on pfs" under News heading in this link:
http://www.pfs-ifa.co.uk/index.php
I tried other combinations too but no luck.
no sorry my bad for not explaining fully.
I have a site that has index.php and that is static, not wordpress' index.php, that has the snippets of code I gave. I could have made this home.php but it has to be a php file.
my blog/wordpress is in a directory called resources, so really my index.php is not in wordpress, but I would take it the mini loop could be put into any page through wordpress. I can see why you are confused. in the resources/wordpress directory there is another index.php but only for that directory (wordpress' index.php)
edit: go to that site I linked to the pfs one, and click on the links at the very top, then look at your address bar, they are all index.php files in that site
You can save this as your home.php and set wordpress to display this as a static home page.
Example:
Can anyone just step me through how to do this? Im failing big time. missing something.
How do I set a static home page (where does it need to be in my server directory), where do I put what code, and what setting do I set up in the admin panel?
Thanks so much
where is you wp set? e.g. www.lin.co.uk/ or www.lin.co.uk/blog (or www.lin.co.uk/wordpress)
ik
so wordpress is there? not in its own directory?
I think you will have to make a page like the home.php file, and select that as your single page
I always put wordpress in its own directory so I can have more control over the sites I have done with it
from the full thread, I think your wanting a static home page then be able to link into wordpress.
I would.
I added wordpress 2.7 to my kung fu site. I put wordpress into a directory called blog.
but my home page links into it.
I know earlier you got confused about my index.php example, but what I was trying to show you there was that you can still access the wordpress loop from outside the wordpress directory.
see if this is what your looking to achieve linking wise: www.woskf.co.uk
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:
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:
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
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?
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
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.
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.
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.