WordPress.org

Ready to get started?Download WordPress

Forums

Can't see comment list (3 posts)

  1. aquanat
    Member
    Posted 1 year ago #

    Hi!

    I can't see comments list in my post.

    comments.php

    <!-- Check Authorize -->
    <?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()){
    		?> <p class="nopassword">This post is password protected. Enter the password to view comments.</p> <?php
    		return;
    	}
    ?>
    <!-- Comment List -->
    <?php if ( have_comments() ) : ?>
    	<div id="comments" class="comment-title gdl-blog-info-title gdl-title">
    	<?php comments_number(__('No Comment','gdl_front_end'), __('One Comment','gdl_front_end'), __('% Comments','gdl_front_end') );?>
    	</div>
    	<ol class="comment-list">
    		<?php wp_list_comments(array('callback' => 'get_comment_list')); ?>
    	</ol>
    	<!-- Comment Navigation -->
    	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    		<br>
    		<div class="comments-navigation">
    			<div class="previous"> <?php previous_comments_link('Older Comments'); ?> </div>
    			<div class="next"> <?php next_comments_link('Newer Comments'); ?> </div>
    		</div>
    	<?php endif; ?>
    <?php endif; ?>
    <!-- Comment Form -->
    <?php 
    
    	// Translator words
    	global $gdl_admin_translator;
    	if( $gdl_admin_translator == 'enable' ){
    		$translator_leave_reply = get_option(THEME_SHORT_NAME.'_translator_leave_reply', 'Leave a Reply');
    	}else{
    		$translator_leave_reply = __('Leave a Reply','gdl_front_end');
    	}
    /*
    	$comment_form = array(
    		'fields' => apply_filters( 'comment_form_default_fields', array(
    			'author' => '<div class="comment-form-author">Nome' .
    						'<input id="author" name="author" type="text" value="' .
    						esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1" />' .
    						'</div><label for="author">asddsa' . __( 'Name', 'gdl_front_end' ) . '</label> ' .
    						( $req ? '<span class="required">*</span>' : '' ) .
    						'<div class="clear"></div>' .
    						'</div><!-- #form-section-author .form-section -->',
    			'email'  => '<div class="comment-form-email">' .
    						'<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" tabindex="2" />' .
    						'<label for="email">' . __( 'Email', 'gdl_front_end' ) . '</label> ' .
    						( $req ? '<span class="required">*</span>' : '' ) .
    						'<div class="clear"></div>' .
    						'</div><!-- #form-section-email .form-section -->',
    			'url'    => '<div class="comment-form-url">' .
    						'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" />' .
    						'<label for="url">' . __( 'Website', 'gdl_front_end' ) . '</label>' .
    						'<div class="clear"></div>' .
    						'</div><!-- #form-section-url .form-section -->' ) ),
    		'comment_field' => '<div class="comment-form-comment">' .
    					'<textarea id="comment" name="comment" aria-required="true"></textarea>' .
    					'</div><!-- #form-section-comment .form-section -->',
    		'comment_notes_before' => '',
    		'comment_notes_after' => '',
    		'title_reply' => $translator_leave_reply,
    	);
    	*/
    
    $defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array(
        'author' => '<p class="comment-form-author">' .
                    '<label for="author">' . __( 'Namertr' ) . 'asd</label> ' .
                    ( $req ? '<span class="required">*</span>' : '' ) .
                    '<input id="author" name="author" type="text" value="' .
                    esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' />' .
                    '</p><!-- #form-section-author .form-section -->',
        'email'  => '<p class="comment-form-email">' .
                    '<label for="email">' . __( 'Email' ) . '</label> ' .
                    ( $req ? '<span class="required">*</span>' : '' ) .
                    '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' />' .
                    '</p><!-- #form-section-email .form-section -->',
        'url'    => '<p class="comment-form-url">' .
                    '<label for="url">' . __( 'Website' ) . '</label>' .
                    '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" />' .
                    '</p><!-- #form-section-url .form-section -->' ) ),
        'comment_field' => '<p class="comment-form-comment">' .
                    '<label for="comment">' . __( 'Comment' ) . '</label>' .
                    '<textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea>' .
                    '</p><!-- #form-section-comment .form-section -->',
        'must_log_in' => '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
        'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ),
        'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>',
        'comment_notes_after' => '<dl class="form-allowed-tags"><dt>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</dt> <dd><code>' . allowed_tags() . '</code></dd></dl>',
        'id_form' => 'commentform',
        'id_submit' => 'submit',
        'title_reply' => __( 'Leave a Reply' ),
        'title_reply_to' => __( 'Leave a Reply to %s' ),
        'cancel_reply_link' => __( 'Cancel reply' ),
        'label_submit' => __( 'Post Comment' ),
    );
    comment_form($defaults, $post->ID);
    ?>

    single.php

    <?php get_header(); ?>
    	<?php
    		// Check and get Sidebar Class
    		$sidebar = get_post_meta($post->ID,'post-option-sidebar-template',true);
    		global $default_post_sidebar;
    		if( empty( $sidebar ) ){ $sidebar = $default_post_sidebar; }
    		if( $sidebar == "left-sidebar" || $sidebar == "right-sidebar"){
    			$sidebar_class = "sidebar-included " . $sidebar;
    		}else if( $sidebar == "both-sidebar" ){
    			$sidebar_class = "both-sidebar-included";
    		}else{
    			$sidebar_class = '';
    		}
    
    		// Translator words
    		if( $gdl_admin_translator == 'enable' ){
    			$translator_about_author = get_option(THEME_SHORT_NAME.'_translator_about_author', 'About the Author');
    			$translator_social_share = get_option(THEME_SHORT_NAME.'_translator_social_shares', 'Social Share');
    		}else{
    			$translator_about_author = __('About the Author','gdl_front_end');
    			$translator_social_share = __('Social Share','gdl_front_end');
    		}
    
    	?>
    	<div class="content-wrapper <?php echo $sidebar_class; ?>">
    		<div class="clear"></div>
    		<?php
    			$left_sidebar = get_post_meta( $post->ID , "post-option-choose-left-sidebar", true);
    			$right_sidebar = get_post_meta( $post->ID , "post-option-choose-right-sidebar", true);
    			global $default_post_left_sidebar, $default_post_right_sidebar;
    			if( empty( $left_sidebar )){ $left_sidebar = $default_post_left_sidebar; }
    			if( empty( $right_sidebar )){ $right_sidebar = $default_post_right_sidebar; } 
    
    			echo "<div class='gdl-page-float-left'>";
    
    		?>
    
    		<div class='gdl-page-item'>
    
    		<?php
    			if ( have_posts() ){
    				while (have_posts()){
    					the_post();
    
    					echo '<div class="sixteen columns mt0">';	
    
    					// Single header
    					echo '<div class="single-thumbnail-info post-info-color gdl-divider">';
    					echo '<div class="single-thumbnail-date">' . get_the_time( GDL_DATE_FORMAT ) . '</div>';
    					echo '<div class="single-thumbnail-author"> ' . __('by','gdl_front_end') . ' ' . get_the_author_link() . '</div>';
    					echo '<div class="single-thumbnail-comment">';
    					comments_popup_link( __('0 Comment','gdl_front_end'),
    						__('1 Comment','gdl_front_end'),
    						__('% Comments','gdl_front_end'), '',
    						__('Comments are off','gdl_front_end') );
    					echo '</div>';
    
    					the_tags('<div class="single-thumbnail-tag">', ', ', '</div>');
    					echo '<div class="clear"></div>';
    					echo '</div>';
    
    					// Inside Thumbnail
    					if( $sidebar == "left-sidebar" || $sidebar == "right-sidebar" ){
    						$item_size = "640x240";
    					}else if( $sidebar == "both-sidebar" ){
    						$item_size = "460x140";
    					}else{
    						$item_size = "940x300";
    					} 
    
    					$inside_thumbnail_type = get_post_meta($post->ID, 'post-option-inside-thumbnail-types', true);
    
    					switch($inside_thumbnail_type){
    
    						case "Image" : 
    
    							$thumbnail_id = get_post_meta($post->ID,'post-option-inside-thumbnial-image', true);
    							$thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size );
    							$thumbnail_full = wp_get_attachment_image_src( $thumbnail_id , 'full' );
    							$alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);
    
    							if( !empty($thumbnail) ){
    								echo '<div class="blog-thumbnail-image">';
    								echo '<a href="' . $thumbnail_full[0] . '" data-rel="prettyPhoto" title="' . get_the_title() . '" ><img src="' . $thumbnail[0] .'" alt="'. $alt_text .'"/></a>';
    								echo '</div>';
    							}
    							break;
    
    						case "Video" : 
    
    							$video_link = get_post_meta($post->ID,'post-option-inside-thumbnail-video', true);
    							echo '<div class="blog-thumbnail-video">';
    							echo get_video($video_link, gdl_get_width($item_size), gdl_get_height($item_size));
    							echo '</div>';
    							break;
    
    						case "Slider" : 
    
    							$slider_xml = get_post_meta( $post->ID, 'post-option-inside-thumbnail-xml', true);
    							$slider_xml_dom = new DOMDocument();
    							$slider_xml_dom->loadXML($slider_xml);
    
    							echo '<div class="blog-thumbnail-slider">';
    							echo print_flex_slider($slider_xml_dom->documentElement, $item_size);
    							echo '</div>';
    							break;
    
    					}
    
    					echo "<div class='clear'></div>";
    
    					echo "<div class='single-content'>";
    					echo the_content();
    					echo "</div>";
    
    					echo '<div class="clear"></div>';
    
    					// About Author
    					if(get_post_meta($post->ID, 'post-option-author-info-enabled', true) == "Yes"){
    						//echo "<div class='about-author-wrapper'>";
    						////echo "<div class='about-author-avartar'>" . get_avatar( get_the_author_meta('ID'), 90 ) . "</div>";
    						//echo "<div class='about-author-info'>";
    						//echo "<div class='about-author-title gdl-blog-info-title gdl-title'>" . $translator_about_author . "</div>";
    						//echo get_the_author_meta('description');
    						//echo "</div>";
    						//echo "<div class='clear'></div>";
    						//echo "</div>";
    					}
    
    					// Include Social Shares
    					if(get_post_meta($post->ID, 'post-option-social-enabled', true) == "Yes"){
    						echo "<div class='social-share-title gdl-blog-info-title gdl-title'>";
    						echo $translator_social_share;
    						echo "</div>";
    						include_social_shares();
    						echo "<div class='clear'></div>";
    					}
    
    					echo '<div class="comment-wrapper">';
    					comment_form(); 
    
    					echo '</div>';
    
    					echo "</div>"; // sixteen-columns
    				}
    			}
    		?>
    
    		</div> <!-- gdl-page-item -->
    
    		<?php
    			get_sidebar('left');	
    
    			echo "</div>";
    			get_sidebar('right');
    		?>
    
    		<div class="clear"></div>
    
    	</div> <!-- content-wrapper -->
    
    <?php get_footer(); ?>

    What can i do?

  2. Tara
    Member
    Posted 1 year ago #

    have you enabled comments in admin?

  3. aquanat
    Member
    Posted 1 year ago #

    Yes, comments are enabled.
    I can see (at top of post) how many comments has the post.
    And i can approve/unapprove them in admin area....

Topic Closed

This topic has been closed to new replies.

About this Topic