All I need to do is exclude category&tag_ID=3&post_type=post from:
<?php
/*
Template Name: Blog
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<div id="content">
<!--page.php-->
<div id="post" class="post clearfix">
<?php query_posts(array('paged' => get_query_var('paged'),'posts_per_page' =>10)); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
<!--post title-->
<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<!--post text with the read more link-->
<?php the_excerpt(); ?>
<!--for paginate posts-->
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
<?php //comments_template(); // uncomment this if you want to include comments template ?>
<?php endwhile; // end of one post ?>
<div class="page-nav">
<?php wp_pagenavi(); ?> </div>
<?php else : // do not delete ?>
<h3>Page Not Found</h3>
<p>We're sorry, but the page you are looking for isn't here.</p>
<p>Try searching for the page you are looking for or using the navigation in the header or sidebar</p>
<?php
endif; // do not delete ?>
<!--page.php end-->
</div>
</div>
<?php endif; ?>
<?php get_sidebar(' '); ?>
<?php get_footer(' '); ?>
I know it’s somewhere in the "php query there at the top… But I can’t figure out how to incorporate it so that it doesn’t show… Any help would be greatly appreciated.
^^^ see the post “test” it’s categorized under “Memorial” and I don’t want those posts to show up on the blog page with other posts. I want to exclude all posts tagged with “Memorial” from the blog page. I have another section where all those appear “/category/memorial/”
I don’t really want to have to use another plugin for this and don’t want to have to edit much except for the blog.php template which is used to display blog posts… I just want to EXCLUDE “Memorials” which is Category ID 3… Can’t seem to figure this one out…
ah, okay. Do you still only get 10 posts per page? And does the paging actually still work? Or do you have to do a combine effort like so (although I am unsure if it works)
Thank you for the quick response cpradio. I changed the code and it’s not doing anything for me unfortunately. There are 12 posts on the page: http://stlheroinhelp.org/blog/
I’ve got only 10 posts being displayed but I for the life of me cannot figure out how to add page navigation/pagination whatever it’s called… The navigation that populates at the bottom of the page to go to the next page with 10 posts…
<?php
/*
Template Name: Blog
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<div id="content">
<!--page.php-->
<div id="post" class="post clearfix">
<div id="blog-heading"><h1>Blog & News Articles</h1></div>
<?php
$recentPosts = new WP_Query();
$recentPosts->query('posts_per_page=10&cat=-3');
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<!--post title-->
<div id="h2-memorial"><h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2></div>
<!--post text with the read more link-->
<?php the_excerpt(); ?>
<!--for paginate posts-->
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
<?php //comments_template(); // uncomment this if you want to include comments template ?>
<?php endwhile; // end of one post ?>
<div class="page-nav">
<?php wp_pagenavi(); ?> </div>
<?php else : // do not delete ?>
<h3>Page Not Found</h3>
<p>We're sorry, but the page you are looking for isn't here.</p>
<p>Try searching for the page you are looking for or using the navigation in the header or sidebar</p>
<?php
endif; // do not delete ?>
<!--page.php end-->
</div>
</div>
<?php get_sidebar(' '); ?>
<?php get_footer(' '); ?>
CPRADIO if you help me solve this I want your Paypal email address…
You are the friggin MAN! I really can’t thank you enough! Thank you thank you thank you! You solved what’s been eating at me for 2-entire days… And you were just helping. Thank you so much!