WordPress.org

Ready to get started?Download WordPress

Forums

WordPress 2.9 Killing My comments.php for pages (4 posts)

  1. Wp-mod
    Member
    Posted 4 years ago #

    i recently updated to 2.9 to use the post thumbnail but it seems to be crashing my comments.php on pages , please check it out

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    A link to your site might help...

  3. Wp-mod
    Member
    Posted 4 years ago #

    ok this is wordpress 2.9 link

    http://demo.wp-mod.com/page-with-comments/

    where you see comments and the next tabs of share and related posts a re empty

    this is wordpress 2.8.6

    http://wp-mod.com/test6/page-with-comments/

    you can see comments and other tabs too working fine with content
    ,
    theme is coded by me and at first when it was coded for 2.8.6 everything was working fine , suddenly upgrading to 2.9 the pages which has comments only seem to be not displaying other pages, other pages without comments work fine , but when you add one the problem seems to come back

    this is my wp_list_comments loop from functions.php

    function mytheme_comment($comment, $args, $depth) {
    $GLOBALS['comment'] = $comment; ?>
    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>" >
    <div id="comment-<?php comment_ID(); ?>">
    <div class="comment-top">
    <div class="comment-author vcard">
    <?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?>
    <div class="comment-options">
    <?php edit_comment_link(__('<img src="'.get_bloginfo('stylesheet_directory').'/images/edit.png" alt="Edit" title="Edit"/ >'),'','') ?>
    <?php delete_comment_link(get_comment_ID()); ?>
    </div></div>
    <div class="comment-meta commentmetadata">
    <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
    <?php printf(__('%1$s at %2$s'), get_comment_date(),get_comment_time()) ?></a>
    </div>
    </div>
    <div class="comment-data">
    <?php echo get_avatar($comment,$size='65'); ?>
    <?php if ($comment->comment_approved == '0') : ?>
    <em>
    <?php _e('Your comment is awaiting moderation.') ?>
    </em> <br />
    <?php endif; ?>
    <?php comment_text() ?>
    <div class="reply">
             <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
          </div>
         </div>
    </div>
    <?php
    }

    and this is my comments.php

    <?php
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    	die ('Please do not load this page directly. Thanks!');
    if ( post_password_required() ) {
    	echo 'This post is password protected. Enter the password to view comments.';
    	return;
    }
    ?>
    
    <ul class="css-tabs">
        <li><a href="#"><?php comments_number('No Comments','Comment','Comments' );?></a></li>
        <li><a href="#">Share</a></li>
        <li><a href="#">Related Post</a></li>
        <li><a href="#">Trackbacks</a></li>
    </ul> 
    
    <!-- tab "panes" -->
    <ul class="css-panes">
    <li class="tabcontent">
    <?php if ( have_comments() ) : ?>
    
        <h3 id="comments"><?php comments_number('No Comments','1 Comment','Comments (%)' );?></h3>
    <div class="clear"></div>
        <ul class="commentlist">
    
    		<?php wp_list_comments('type=comment&callback=mytheme_comment'); ?>
    
    	</ul>
    
    <?php else : // this is displayed if e are no comments so far ?>
    
    	<?php if ($post->comment_status == 'open') : ?>
            <h3><?php comment_form_title( 'Leave a Comment', 'Leave a Reply to %s' ); ?></h3>
    <div class="clear"></div>
    
        <?php else : ?>
            <h3>Comments are closed.</h3>
    </li>
    <li id="bookmarkus" class="tabcontent">
    
    <h3>Like This Post ?</h3>
    <div class="clear"></div>
    <div class="icons">
                	<a href="<?php echo $wpmod_feedburner_url; ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/feed.png" alt="RSS" title="RSS" /></a>
                	<a href="http://digg.com/submit?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/digg.png" alt="Digg" title="Digg" /></a>
                	<a href="http://twitter.com/home?status=Currently%20reading%20<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/twitter.png" alt="Twitter" title="Twitter" /></a>
                	<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/stumbleupon.png" alt="StumbleUpon" title="StumbleUpon" class="stumbleupon" /></a>
                	<a href="http://del.icio.us/post?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/delicious.png" alt="Delicious" title="Delicious" /></a>
                	<a href="http://www.technorati.com/faves?add=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/technorati.png" alt="Technorati" title="Technorati" /></a>
                	<a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php echo urlencode(get_the_title($id)); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/facebook.png" alt="Facebook" title="Facebook" /></a>
                    <a href="http://www.myspace.com/Modules/PostTo/Pages/?u=<?php the_permalink(); ?>&t=<?php echo urlencode(get_the_title($id)); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/myspace.png" alt="MySpace" title="MySpace" /></a>
                	<a href="http://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/reddit.png" alt="Reddit" title="Reddit" /></a>
    </div>
    </li>
        <li class="tabcontent">
    <h3>Related Posts</h3>
    <div class="clear"></div>
    <div class="post-body">
    <?php
    $tags = wp_get_post_tags($post->ID);
    if ($tags) {
    	$tag_ids = array();
    	foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
    
    	$args=array(
    		'tag__in' => $tag_ids,
    		'post__not_in' => array($post->ID),
    		'showposts'=>5, // Number of related posts that will be shown.
    		'caller_get_posts'=>1
    	);
    
    	$my_query = new wp_query($args);
    	if( $my_query->have_posts() ) {
    		echo '<ul>';
    		while ($my_query->have_posts()) {
    			$my_query->the_post();
    		?>
    			<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    		<?php
    		}
    		echo '</ul>';
    	}
    }
    ?></div></li>
        <li class="post tabcontent">
        <h3 id="trackbacks">Trackbacks and Pingbacks</h3>
    <div class="clear"></div>
    	<ul class="commentlist trackbacklist">
    		<?php wp_list_comments('type=pings&callback=custom_pings'); ?>
    	</ul>
        </li>
    </ul>
    
        <?php endif; ?>
    
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
         <div id="respond">
    
            <br />
            <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
            <p>You must be <a href="<?php bloginfo('url'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
    
            <?php else : ?>
    
            <div id="cancel-comment-reply">
    			<p><?php cancel_comment_reply_link() ?></p>
    
            <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
                <?php comment_id_fields(); ?>
    
                <?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">Logout</a></p>
                <?php else : ?>
    
                    <p>
                   <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" class="input" tabindex="1" /><label for="author">Name <?php if ($req) echo "(required)"; ?></label>
                    </p>
    
                    <p>
                    <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="50" class="input" tabindex="2" /><label for="email">Mail </label><?php if ($req) echo "(required)"; ?>
                    </p>
    
                    <p>
                    <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="50"  class="input" tabindex="3" /><label for="url">Website</label>
                    </p>
                <?php endif; ?>
    
                <p>
                <label for="data">Comment</label>
                <textarea name="comment" id="data" cols="60" rows="7" tabindex="4"></textarea></p>
    
                <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    
                </p>
    
                <?php do_action('comment_form', $post->ID); ?>
    
            </form>
    <?php endif; ?>
    
    	</div>
        </div>
    </li>
        <li id="bookmarkus" class="tabcontent">
    <h3>Like This Post ?</h3>
    <div class="clear" ></div>
    <div class="icons">
                	<a href="<?php echo $wpmod_feedburner_url; ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/feed.png" alt="RSS" title="RSS" /></a>
                	<a href="http://digg.com/submit?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/digg.png" alt="Digg" title="Digg" /></a>
                	<a href="http://twitter.com/home?status=Currently%20reading%20<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/twitter.png" alt="Twitter" title="Twitter" /></a>
                	<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/stumbleupon.png" alt="StumbleUpon" title="StumbleUpon" /></a>
                	<a href="http://del.icio.us/post?url=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/delicious.png" alt="Delicious" title="Delicious" /></a>
                	<a href="http://www.technorati.com/faves?add=<?php the_permalink() ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/technorati.png" alt="Technorati" title="Technorati" /></a>
                	<a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&t=<?php echo urlencode(get_the_title($id)); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/facebook.png" alt="Facebook" title="Facebook" /></a>
                	<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=<?php the_permalink(); ?>&t=<?php echo urlencode(get_the_title($id)); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/myspace.png" alt="MySpace" title="MySpace" /></a>
                	<a href="http://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><img src="<?php bloginfo('template_url');?>/images/reddit.png" alt="Reddit" title="Reddit" /></a>
    </div>
    </li>
        <li class="tabcontent">
    <h3>Related Posts</h3>
    <div class="clear"></div>
    <div class="post-body">
    <?php
    $tags = wp_get_post_tags($post->ID);
    if ($tags) {
    	$tag_ids = array();
    	foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
    
    	$args=array(
    		'tag__in' => $tag_ids,
    		'post__not_in' => array($post->ID),
    		'showposts'=>5, // Number of related posts that will be shown.
    		'caller_get_posts'=>1
    	);
    
    	$my_query = new wp_query($args);
    	if( $my_query->have_posts() ) {
    		echo '<ul>';
    		while ($my_query->have_posts()) {
    			$my_query->the_post();
    		?>
    			<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    		<?php
    		}
    		echo '</ul>';
    	}
    }
    ?></div></li>
        <li class="post tabcontent">
        <h3 id="trackbacks">Trackbacks and Pingbacks</h3>
    <div class="clear"></div>
    	<ul class="commentlist trackbacklist">
    		<?php wp_list_comments('type=pings&callback=custom_pings'); ?>
    	</ul>
        </li>
    </ul>
    
    <?php endif; ?>

    this problem occurs only on pages no posts , so i think i have given you all details please help

  4. Wp-mod
    Member
    Posted 4 years ago #

    can any one help please

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.