Wordpress and Webdesign Forum go41 » WordPress Code Snippets

  1. omerkhan01
    Member

    Hi there,

    My site is here
    Just wondering how I can remove the dates and comment text from from my front page
    without effecting any div's or the code in index.php. Also on a page at the bottom it says comments are closed and edit this entry. How can I remove that and also from post pages

    Thanks

    Omar

    Posted 1 year ago #
  2. on your frontpage these entries are only in the featured section I think.

    frontpage is index.php, here you have to remove some lines below <div id="featured"> the following line which is the complete div class="meta" ... /div

    <div class="meta">[<?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?>]</div>

    should not effect other divs.

    Coming to single post view in single.php

    If you want to remove the part just below the title (date and comments) you can delete the following lines in single.php

    <div id="stats">
    <span><?php the_time('j F Y') ?></span>
    <span><?php if(function_exists('the_views')) { the_views(); } ?></span>
    <span><?php comments_number('No Comment', 'One Comment', '% Comments' );?></span></div>

    That's only the part on top just under the title of your post.

    On the bottom of your single posts or pages it loads the comments template in div id="comments" in single.php for posts or page.php for pages

    <div id="comments">
    	<?php comments_template(); ?>
    	</div>

    So if you delete this three lines given above, there will be no way for any visitor to comment on a post, even if you allow it - the form is gone.

    If you do not get any comments on any post - remove it.

    If there are only some posts where you do not allow comments and it shows: "Comments are closed." you can also remove these words only.

    do this by editing comments.php, look for the words "Comments are closed." in

    <p class="nocomments">Comments are closed.</p>

    and remove here only Comments are closed. to make it look like this:

    <p class="nocomments"></p>

    The link to edit posts: Only you see this while you are logged in, I would leave it in place and like to have it even in single.php to edit any entry easily.

    good luck ..

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):