Exclude postinfo
-
I want to be able to:
1. Exclude info on posts, everything about the post such as date, category and who wrote it.
2. Exclude the comment service, so users can’t leave comments.
About 1. Iv’e found a widget that excluded the date but not the other things.
Thank you!
-
You can do this by editing
single.phpin your theme folder. What’s the code in yoursingle.php‘s loop?<?php get_header(); ?>
<!– posts –>
<div id=”posts” class=”span-16 prepend-1 append-1″>
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<div class=”postheader”>
<div class=”commentcount”>
“>
<img src=”<?php bloginfo(‘template_directory’); ?>/images/commentsicon.gif” alt=”<?php comments_number(__(‘No Comments’), __(‘1 Comment’), __(‘% Comments’)); ?>” />
<?php comments_number(__(‘0’), __(‘1’), __(‘%’)) ?>
</div>
<div class=”posttitle”>
<h2>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
<span class=”postmeta”><?php the_time(‘l, F jS, Y’); ?> | <?php the_category(‘, ‘); ?> | <?php the_author_link(); ?> </span>
</div>
</div>
<div class=”postcontent”><?php the_content(__(‘
Continue reading…’)); ?></div>
<div class=”posttags”><?php the_tags(‘Tags: ‘, ‘, ‘, ”); ?></div>
</div><?php comments_template(); ?>
<?php endwhile; ?>
<div class=”navlinks”>
<img src=”<?php bloginfo(‘template_directory’); ?>/images/backtotopicon.gif” alt=”Back to top” />Back to top
</div><?php else : ?>
<div class=”post”>
<h2>Not found!</h2>
<p><?php _e(‘Sorry, this page does not exist.’); ?></p>
<?php include (TEMPLATEPATH . “/searchform.php”); ?>
</div><?php endif; ?>
</div><?php get_sidebar(); ?>
<?php get_footer(); ?>
I’ve commented the lines out which you need to remove entirely if don’t want these features. You can turn comments off within the WordPress admin area also.
<?php get_header(); ?> <!-- posts --> <div id="posts" class="span-16 prepend-1 append-1"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="postheader"> <div class="commentcount"> "> <img src="<?php bloginfo('template_directory'); ?>/images/commentsicon.gif" alt="<?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?>" /> <?php comments_number(__('0'), __('1'), __('%')) ?> </div> <div class="posttitle"> <h2>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h2> <!-- <span class="postmeta"><?php /* the_time('l, F jS, Y'); */ ?> | <?php /* the_category(', '); */ ?> | <?php /* the_author_link(); */ ?> </span> --> </div> </div> <div class="postcontent"><?php the_content(__(' Continue reading...')); ?></div> <div class="posttags"><?php the_tags('Tags: ', ', ', ''); ?></div> </div> <?php /* comments_template(); */ ?> <?php endwhile; ?> <div class="navlinks"> <img src="<?php bloginfo('template_directory'); ?>/images/backtotopicon.gif" alt="Back to top" />Back to top </div> <?php else : ?> <div class="post"> <h2>Not found!</h2> <p><?php _e('Sorry, this page does not exist.'); ?></p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> </div> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>Oh I just noticed the code you posted is broken on this line.
Change.
<h2>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h2>to
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></h2>Thank you very much,
Did you change the code so It’s just for me to copy/paste?
Cause I cants see any comments in the code?
I deleted theese lines, since I guess it was theese you ment, but it dint change anything?
/* comments_template(); */
/* the_time(‘l, F jS, Y’); */
*/ ?> | <?php /* the_author_link(); */
/* the_category(‘, ‘); */
Ok, I fixed it, I had to change the index.php file aswell
The topic ‘Exclude postinfo’ is closed to new replies.