Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Stop certain posts from appearing on home page ?


  #1  
Old Oct 8, 2011, 08:11 AM
jonb2010
 
14 posts · Jun 2011
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
  #2  
Old Oct 8, 2011, 07:19 PM
juggledad's Avatar
juggledad
 
23,671 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Oct 8, 2011 at 07:21 PM.
  #3  
Old Oct 9, 2011, 03:56 AM
jonb2010
 
14 posts · Jun 2011
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 ?
  #4  
Old Oct 11, 2011, 10:32 AM
jonb2010
 
14 posts · Jun 2011
Anybody got any ideas ?
  #5  
Old Oct 11, 2011, 11:48 AM
juggledad's Avatar
juggledad
 
23,671 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try changing the line to
$args = $args + '&cat='-108'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Oct 15, 2011, 01:31 AM
jonb2010
 
14 posts · Jun 2011
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'); ?>
  #7  
Old Oct 15, 2011, 03:24 AM
juggledad's Avatar
juggledad
 
23,671 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Be glad to take a look but it won't be till Sunday due to an all day commitment today
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Posts page jumps down and around when loading - how do I stop it? tomsimone Center area post/pages 2 May 30, 2011 10:49 PM
Excluding Posts from a category appearing in chronological page navigation. threedogmoon Center area post/pages 4 Apr 26, 2011 04:32 PM
How can I stop horizontal lines appearing across header image? MarkSK Header configuration & styling 1 Oct 8, 2010 04:29 PM
BUGFIX 351/352-01: EXCERPTS - Show first X posts on HOME page as full posts juggledad Old Version fixes and change logs 1 Jul 13, 2010 05:42 AM
[SOLVED] 3.5.1 Bug? Show the first X posts on HOME page as full posts - not working Fux Excerpts, Read more, Pagination 6 May 30, 2010 01:59 AM


All times are GMT -6. The time now is 03:24 PM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.