Stop certain posts from appearing on home page ?
I am trying to stop certain posts from appearing on the front page of www.mummybird.com
I have created a page for reviews as I don't want the reviews clogging up the home page. I've added this to the index.php <?php if (is_front_page() && !is_paged() ) $posts = query_posts($query_string . '&cat=-108'); ?> It works on the first home page but the review posts then start appearing on the second page. It's also started doubling posts that appear on the first page and putting then on the second page again. Anybody got any suggestions how I can make this happen ? thanks Jon |
what are the review posts?
where did you add that code in index.php? take a look at the custom query template in the Gold Forum/Tutorials |
Review posts are just in the Review category to appear only on the Review Page.
I've been trying the custom query you mentioned but whatever I try it try I end up with no posts on the front page at all. I saved the template as home.php and edited it like below, then tried it without the separate "$args =;" and it still doesn't show any pages. $custom_fields = get_post_custom($post->ID); $my_custom_field = $custom_fields['custom_query']; $args = ''; $args = query_posts( 'cat=-108' ); if (have_posts()) { $paged = (get_query_var('paged')); get_query_var('paged'); $args= $args."&paged=$paged"; } query_posts($args); ?> I've had to delete home.php from the server as every time I upload it I lose my front page posts. Not sure what I'm doing wrong. Any ideas ? |
Anybody got any ideas ?
|
Try changing the line to
$args = $args + '&cat='-108' |
Hi Juggledad, I just tried that bit it comes up with this error on the front page and doesn't load.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/donna/public_html/wp-content/themes/atahualpa/home.php on line 21 If I gave you a login would you be able to take a look ? Quite happy to make a donation for your help :) I've put this back into the original index.php in the meantime. <?php if (is_front_page() && !is_paged() ) $posts = query_posts($query_string . '&cat=-108'); ?> |
Be glad to take a look but it won't be till Sunday due to an all day commitment today
|
All times are GMT -6. The time now is 05:56 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.