0

Hey i tried using wordpress threaded comment feature but didn't work coz of custom theme. I have tried wp threaded comments plugin it works like a charm but unfortunately it has a conflict with the FV community news plugin, It shows a reply button on the community news area/widget.

So i tried to do it manually... no luck. can anyone suggest me or point meto somewhere i can get some data to fix this.

My wordpress version is 3.0.4 cheers

Current COmment . php

<?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 (!empty($post->post_password)) { // if there's a password
        if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
            ?>

            <p>This post is password protected. Enter the password to view comments.</p>

            <?php
            return;
        }
    }

    /* This variable is for alternating comment background */
    $oddcomment = 'alt';
?>
<?php if ( $comments ) : ?>
<!-- You can start editing here. -->

            <?php $urlHome = get_bloginfo('template_directory'); ?>
                        <div class="box post-comments" id="comments">
                <div class="content">
                    <h4>Awesome Comments!</h4>

                    <?php foreach ($comments as $comment) : ?>
                   <?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
                     <div id="comment-<?php comment_ID() ?>" class="fl ar">

                        <div class="pic"><?php echo get_avatar( $comment, 80, $default = $urlHome . '/images/default_avatar_visitor.gif' ); ?></div>
                        <div class="comm-name"><a href="<?php comment_author_url(); ?>" target="_blank" rel="nofollow"><?php comment_author(); ?></a></div>
                        <div class="comm-date"><small><em><?php the_time('m.d.y') ?></em></small></div>
                     </div>
                     <div class="fr">
                       <div class="box2 <?php echo $oddcomment; ?>">
                         <?php comment_text() ?>
                       </div><!--/box2 -->
                     </div>   <div class="fix"></div>

                        <?php $oddcomment = ( empty( $oddcomment ) ) ? 'alt' : ''; ?> 
                        <?php } /* End of is_comment statement */ ?>
                                    <?php endforeach; // end for each comment ?>

                </div> </div>
               <div class="box">
               <div class="content">
<h3 id="trackbacks">Trackbacks</h3>
<ol class="trackbacksol">
    <?php //Displays trackbacks only
    foreach ($comments as $comment) : ?>
        <?php $comment_type = get_comment_type(); ?>
        <?php if($comment_type != 'comment') { ?>
        <li><?php comment_author_link() ?></li>
    <?php }  endforeach; ?>
</ol>
</div></div>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?> 
            <div id="respond" class="box post-comments">
                <div class="content">
                    <h4>Leave Your Response</h2>

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

                    <div class="fl">
                        <?php if ( is_user_logged_in() ) {?>
                        <div class="pic"><img src="<?php bloginfo('template_directory'); ?>/images/default_avatar_visitor.gif" alt="" /></div>
                        <?  } else { ?>
                         <p>Your Name: </p>
                        <p style="margin-top:9px;">Your Email: </p>
                        <p style="margin-top:12px;">Website: </p>
                        <p style="margin-top:15px;">Comments: </p> <? } ?>
                    </div>
                    <div class="fr">
                        <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
                            <fieldset class="message">
                            <?php if ( $user_ID ) : ?>
                                <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a></p>
                            <?php else : ?>
                            <div>
                                <input name="author" id="author" type="text" value="" />
                            </div>
                            <div>
                                <input name="email" id="email" type="text" value="" />
                            </div>
                            <div>
                                <input name="url" id="url" type="text" value="" />
                            </div>
                            <?php endif; ?>
                            <div class="textarea">
                                <textarea name="comment" id="comment" cols="" rows=""></textarea>
                            </div>
                            <div class="submit">
                                <input name="submit" id="submit" type="image" src="<?php bloginfo('template_directory'); ?>/images/btn-submit.gif" value="Send" class="btn"  />
                            </div>
                            <div class="notice">* Name, Email, Comment are Required</div>
                            <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
                            <?php do_action('comment_form', $post->ID); ?>
                            </fieldset>
                        </form>
                        <?php endif; // If registration required and not logged in ?>
                    </div>
                    <div class="fix"></div>
                </div>
                <!--/content -->
            </div>
            <!--/box -->
            <?php endif; // if you delete this the sky will fall on your head ?>

1 Answer 1

1

Does it not work because theme is old or simply coded in incompatible way?

There is this article in Codex that might be relevant - Migrating Plugins and Themes to 2.7/Enhanced Comment Display.

Otherwise I'd take a look at some modern theme (like Twenty Ten) and see how is it properly coded for current WordPress version.

5
  • Hello, i have already seen that link and tried to implement some stuf from other articles as well but no help, im adding a copy of my theme in top edit!
    – Ayaz Malik
    Commented Jan 30, 2011 at 15:12
  • @Ayaz Malik yeah, seems to be old stuff... Had you tried looking at any modern theme? Basically most of that stuff goes away and gets replaced with wp_list_comments() and comment_form().
    – Rarst
    Commented Jan 30, 2011 at 15:19
  • hmm i c, i haven't and im not a wordpress guy first time editing wordperss, so i guess i have to do my research now lol.
    – Ayaz Malik
    Commented Jan 30, 2011 at 17:54
  • @Ayaz Malik well, I could update your template - which will make me very bored and you no closer to understanding what is going on in your theme. But as I recommended above - I think it's better if you take a look at comments.php in modern theme (again - Twenty Ten is kinda official one), try to understand the difference and maybe ask more specific questions about mechanics of comments. Remember - this site is mostly about helping other people learn, not do something instead of them. :)
    – Rarst
    Commented Jan 30, 2011 at 18:55
  • yup i totally understand and its fun learning on my own thts why i never put anythign at first just as suggestion as i am a php coder :D . i have already implemented it and working on the css, here is my test site. zzznetworks.com/blog/2011/01/22/download-test-page take a look :) thanks for pointing to right direction
    – Ayaz Malik
    Commented Jan 30, 2011 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.