Limit number of sticky posts on home page
Hi there,
I am busy working on my site and I want to be able to limit the amount of sticky posts shown on the homepage. In other words, on the homepage, I want there to be the 4 most sticky posts and then the rest of the posts in date order below them. I want this only on the homepage (on on other pages the normal posts in date order must be shown). I know I probably need to edit the loop. Can you please advise? This is what I currently have in the loop: PHP Code:
|
You might want to look at AStickyPostOrderER plugin as opposed to fiddling with code.
|
I have given that plugin a try - but its way more than I need. In fact, its just an extra step and I would prefer the loop code to do it automatically.
All I want to do is limit the number of sticky posts shown. This site shows the code to insert: http://justintadlock.com/archives/20...s-in-wordpress However, Atahualpa uses a loop code that seems to be different from other loops that I have seen. Can anyone else help? I will be so thankful! |
Have you tried sticking that code in the "ATO>Style & edit CENTER COLUMN>Content ABOVE the LOOP" box? I just did that and it worked pretty sweet. Nice catch on that code. That's a keeper.
|
I just discovered that the stickies are not limited to the Home page. I will have to test a bit.
|
This works. I just put at the bottom of the ATO>Style & edit CENTER COLUMN>Content ABOVE the LOOP" box
HTML Code:
<?php if ( is_front_page() ) { ?> |
lmilesw, I did that exactly as you said and it works. However, it shows just the sticky posts and thats it.
What I would love now is for the rest of the blog posts to show under these sticky posts. Any ideas? |
I see what you mean and I have been fiddling with this code for a couple of hours now. I did find that the following works as the previous but has a bit less code.
HTML Code:
<?php if ( is_front_page ){ Are there any coders out there who can help? |
All times are GMT -6. The time now is 03:41 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.