netbuddy34
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude category when using multiple loops/queriesStill cant get this to work. Of course getting a reply in the support forums would be a miracle but here goes.
This is my home.php
<?php get_header(); ?> <div id="wrapper"> <div id="content-wrapper"> <div id="content"> <strong>// original query runs in The (real) Loop first <?php while ( have_posts() ) : the_post(); // detect posts matching our exclusion criteria <?php if (in_category(1)) { $wp_query->post_count++; // increment the post counter continue; } <?php endif; ?> <?php endwhile; ?> // now make a new query and show the posts for real, with the adjusted post count and filtering <?php $my_new_query = new WP_Query($query_string.'&showposts='.$wp_query->post_count); ?> // do another The Loop (and display the results this time) <?php while ( $my_new_query->have_posts() ) : $my_new_query->the_post(); // detect and exclude these same posts <?php if (in_category(1)) { continue; }</strong> <?php // check for thumbnail $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); // check for thumbnail class $thumb_class = get_post_meta($post->ID, 'Thumbnail Class', $single = true); // check for thumbnail alt text $thumb_alt = get_post_meta($post->ID, 'Thumbnail Alt', $single = true); ?> <div class="post-wrapper"> <div class="post"> <div class="homepost-rating"> <?php if (function_exists('ratings_table')) ratings_table(); ?> </div> <div class="homepost-content"> <span class="titles"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?> </a></span> <?php the_excerpt(); ?> </div> <div class="reviews"> <div class="reviewcount"><a href="<?php the_permalink(); ?>"> <?php comments_number('0', '1', '%' );?> Reviews</a></div> <div class="visitsite"> <?php visit_site_link('Visit Site'); ?> </div> </div> </div> </div> <?php comments_template(); ?> <?php endwhile; ?> <p class="pagination"> <?php next_posts_link('« Previous Entries') ?> <?php previous_posts_link('Next Entries »') ?> </p> <?php else : ?> <h2 >No Results Found</h2> <p>Sorry, your search returned zero results. </p> <?php endif; ?> </div> <div id="mostcommentposts"> <div id="mostcommentposts-left"> <ul class="idTabs"> <li><a href="#recentcomments2">Recent Comments</a></li> <li><a href="#topcommentors">Top Commentors</a></li> </ul> <div id="recentcomments2"> <span class="toptitle"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/icon-comments2.gif" alt="icon comments" class="icons" />Recent Comments</span> <ul class="list2"> <?php recent_comments(); ?> </ul> </div> <div id="topcommentors"> <span class="toptitle"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/icon-popular.gif" alt="icon reviewers" class="icons" />Top Commentors</span> <ul class="list2"> <?php ns_show_top_commentators(); ?> </ul> </div> </div> <div id="mostcommentposts-right"> <div id="adsense150"> <?php include 'adsense150.php';?> </div> </div> </div> </div> <?php get_sidebar(); ?> <?php get_footer(); ?> </body></html>
The part of bolded is where I should be setting this up. All I want is for posts only in one category to display on the frontpage and for the counter to be updates so there are always 10 “Scripts” post on the frontpage.
Any help would be a godsend.
Forum: Fixing WordPress
In reply to: Exclude category when using multiple loops/queriesI have similiar code on the front page and would like to exclude all categories bar one.
<?php if (have_posts()) : while (have_posts()) : the_post(); if($post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
I only want posts from “Scripts” category to come up on the homepage, and I dont want the hidden posts to be subtracted from the number of posts I want on the front page either, ie 10…still not sure how to work the code into that loop.
Forum: Plugins
In reply to: Sociable plugin only on selected pages.Figured out the solution, just in case it helps anyone here it is.
<?php if (is_page(array('Freebies', 'Basic Comparison', 'Advanced Comparison'))) : ?> <?php if (function_exists('sociable_html')) { echo sociable_html(); } ?> <?php else : ?> <?php endif; ?>
Forum: Plugins
In reply to: Sociable plugin only on selected pages.still cant get this one to work, just not sure why its throwing an error.
Forum: Fixing WordPress
In reply to: Most commented from certain categoryI also tried the most_commented plugin and tried this.
<?php if (in_category(‘Scripts’)&&function_exists(‘mdv_most_commented’)) mdv_most_commented(); ?>
That didnt work either.
Forum: Fixing WordPress
In reply to: Most commented from certain categoryAnyone got a solution for this one? Should i be using in_category somewhere? Ive tried everything i can think of to get it only to display “Script” items.