Forums

my website is going great, I just want to hide 0 comments on blog posts (10 posts)

  1. triplecu
    Member
    Posted 1 year ago #

    I am using the theme Station 2.0.0 by PageLines

    my website http://www.nsproductions.info

    See how on the blog it says 0 comments? I just want to make that disappear and ill be happy. Only admin's will have access to the main site, users must use forums only

    Also if possible, you see the Meta bar with admin? anyway I can delete
    # Entries RSS
    # Comments RSS
    # WordPress.org
    ad just keep admin login and logout? thanks guys appreciate it alot

  2. kniland
    Member
    Posted 1 year ago #

    Have you unchecked the comment box on the backend of your post?
    This is a screen shot of what I'm talking about, http://i48.tinypic.com/29e57wz.png

  3. converting2wp
    Member
    Posted 1 year ago #


  4. converting2wp
    Member
    Posted 1 year ago #

    Here's what I use for admin login/site admin when there's no need for the "registration" and "subscribers" don't need access to the backend.

    <ul>
    <li>
    <?php
    wp_loginout(); // can redirect to home page if appropriate
    ?>
    </li>
    <?php
    global $user_level;
    if (is_user_logged_in() && $user_level > 0) { wp_register( ); }
    ?>
    </ul>
  5. triplecu
    Member
    Posted 1 year ago #

    to KNiland, yes both are unchecked, I think its the theme displaying that it has o comments which I need to learn how to disable

    to converting2wp will that leave admin login still available but just disable the other stuff? and where do I post that code, what section

  6. converting2wp
    Member
    Posted 1 year ago #

    wp_loginout: If people are logged out, they'll see a "login" link. If logged in, they'll see "logout".

    wp_register: Shows a "Site Admin" link if the user is logged in. You don't need the "if (...)" if you've turned off user registrations (see the link to the codex).

    Where you put the code depends on your theme. I often put it in the footer (out of the way unless you are looking for it). If you can find the code (in sidebar.php?) for

    However, some themes strongly encourage the use of widgets instead of changing the code in theme files. If you need this as a widget you might find a customizable Meta widget -- custom-meta popped up in my search.

    There's a related issue with the way the theme treats comments. If it doesn't have a configuration option to turn off the "comments (#)" you'll need to find the PHP file that generates that HTML and change it to generate what you want. If there's a forum for the theme, someone else may have solved that problem and you might get a quicker response there.

  7. triplecu
    Member
    Posted 1 year ago #

    I couldn't manage to find anything, but here is my comment code, I do not know too much about HTML let me know if you see anything you think may fix this (btw thanks for the admin login fix)

    <?php

    // Do not delete these lines
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');

    if ( post_password_required() ) { ?>
    <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', TDOMAIN);?></p>
    <?php
    return;
    }
    ?>

    <!-- You can start editing here. -->

    <?php if ( have_comments() ) : ?>
    <h3 id="comments"><?php comments_number(__('No Response »', TDOMAIN), __('1 Response »', TDOMAIN), __ngettext('% Response', '% Responses', get_comments_number (),TDOMAIN));?> <?php _e('to “',TDOMAIN);?><?php the_title(); ?>”</h3>

    <ol class="commentlist">
    <?php wp_list_comments(); ?>

    <div class="navigation">
    <div class="alignleft"><?php previous_comments_link() ?></div>
    <div class="alignright"><?php next_comments_link() ?></div>
    </div>
    <?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post->comment_status) : ?>
    <!-- If comments are open, but there are no comments. -->

    <?php else : // comments are closed ?>
    <!-- If comments are closed. -->
    <p class="nocomments"><?php _e('Comments are closed.', TDOMAIN);?></p>

    <?php endif; ?>
    <?php endif; ?>

    <?php if ('open' == $post->comment_status) : ?>

    <div id="respond" name="respond">

    <h3><?php comment_form_title( __('Leave a Reply', TDOMAIN), __('Leave a Reply to %s', TDOMAIN) ); ?></h3>

    <div class="cancel-comment-reply">
    <small><?php cancel_comment_reply_link(); ?></small>
    </div>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p><?php _e('You must be', TDOMAIN);?> /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in',TDOMAIN);?> <?php _e('to post a comment.', TDOMAIN);?></p>
    <?php else : ?>

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    <?php if ( $user_ID ) : ?>

    <p><?php _e('Logged in as', TDOMAIN);?> /wp-admin/profile.php"><?php echo $user_identity; ?>. " title="<?php _e('Log out of this account', TDOMAIN);?>"><?php _e('Log out »', TDOMAIN);?></p>

    <?php else : ?>

    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small><?php _e('Name', TDOMAIN);?> <?php if ($req) echo "(required)"; ?></small></label></p>

    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small><?php _e('Mail (will not be published)', TDOMAIN);?> <?php if ($req) _e('(required)', TDOMAIN); ?></small></label></p>

    <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small><?php _e('Website', TDOMAIN);?></small></label></p>

    <?php endif; ?>

    <?php if(get_option('show_xhtml')):?>
    <p><small>XHTML: <?php _e('You can use these tags:', TDOMAIN);?> <?php echo allowed_tags(); ?></small></p>
    <?php endif;?>

    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

    <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', TDOMAIN);?>" />
    <?php comment_id_fields(); ?>
    </p>
    <?php do_action('comment_form', $post->ID); ?>

    </form>
    <?php endif; // If registration required and not logged in ?>

    </div> <!-- End Respond -->
    <?php endif; // if you delete this the sky will fall on your head ?>

  8. triplecu
    Member
    Posted 1 year ago #

    I take it I have you all stumped now?

  9. converting2wp
    Member
    Posted 1 year ago #

    [A characteristic of the forum is that some of the volunteers who respond don't actually "live" here, so don't take it personally when the responses trickle off.]

    The file above looks like comments.php - a file typically loaded only when a single post is being shown, so it doesn't have anything to do with the "0 Comments" showing on your home page.

    In the Station 2.0.0 files, you will, however, find a file library/_post_footer.php. That file has the code

    <div class="left">
    <span><?php comments_number(0, 1, '%'); ?></span>
    <a href="<?php the_permalink(); ?>#comments" title="<?php _e('View Comments', TDOMAIN);?>">
    <?php _e('Comments',TDOMAIN)?></a>
    </div>

    That code is printing out the "0 Comments". You can just delete those lines (or figure out what the correct conditional logic is, code that and return it to the theme developer). The same applies for the <div class="right"> that generates the other part of the bar at the bottom of each post -- you may want to take out the "Leave a Response" and just leave in the "Edit" post link.

    Since Station has a paid version, if you need additional help, that might be the way to go. It's a fairly complex theme and if you want to be able to upgrade to get its new features, you would, I think, want the developer to know what your requirements are so that they can be included.

  10. triplecu
    Member
    Posted 1 year ago #

    ty s much

Topic Closed

This topic has been closed to new replies.

About this Topic