Forums

Exclude postinfo (8 posts)

  1. cribbe83
    Member
    Posted 3 years ago #

    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!

  2. thelastknight
    Member
    Posted 3 years ago #

    You can do this by editing single.php in your theme folder. What's the code in your single.php's loop?

  3. cribbe83
    Member
    Posted 3 years ago #

    <?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(); ?>

  4. thelastknight
    Member
    Posted 3 years ago #

    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(); ?>
  5. thelastknight
    Member
    Posted 3 years ago #

    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>
  6. cribbe83
    Member
    Posted 3 years ago #

    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?

  7. cribbe83
    Member
    Posted 3 years ago #

    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(', '); */

  8. cribbe83
    Member
    Posted 3 years ago #

    Ok, I fixed it, I had to change the index.php file aswell

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.