Archive for July, 2013

To disable comments for new posts

WordPress Admin Site > Settings > Discussion

To disable comments for previous posts and pages.

UPDATE wp_posts SET comment_status = 'closed' WHERE post_status = 'publish' AND post_type = 'post';# Affected rows: 1
UPDATE wp_posts SET comment_status = 'closed' WHERE post_status = 'publish' AND post_type = 'page';# Affected rows: 6

No Comments

List Posts in Certain Category on Homepage

<?php query_posts('cat=1&showposts=5'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    <?php the_excerpt() ?>
  </li>
<?php endwhile; endif; ?>

No Comments