Home Forums WoodMart support forum Fix bug author and update hEntry’ error Reply To: Fix bug author and update hEntry’ error

#54738

Artem Temos
Keymaster

Try to add the following PHP code snippet to the child theme functions.php file to do this

	function woodmart_post_meta( $atts = array() ) {
		extract(shortcode_atts(array(
			'author'     => 1,
			'author_ava' => 0,
			'date'     => 1,
			'cats'     => 0,
			'tags'     => 0,
			'labels'   => 0,
			'short_labels' => false,
			'edit'     => 1,
			'comments' => 1,
			'limit_cats' => 0
		), $atts));
		?>
			<ul class="entry-meta-list">
				<?php if( get_post_type() === 'post' ): ?>

					<?php // Is sticky ?>

					<?php if( is_sticky() ): ?>
						<li class="meta-featured-post"><?php esc_html_e( 'Featured', 'woodmart' ) ?></li>
					<?php endif; ?>

					<?php // Author ?>
					<?php if ($author == 1): ?>
						<li class="meta-author">
							<?php if ( $labels == 1 && ! $short_labels ): ?>
								<?php esc_html_e('Posted by', 'woodmart'); ?>
							<?php elseif($labels == 1 && $short_labels): ?>
								<?php esc_html_e('By', 'woodmart'); ?>
							<?php endif; ?>
							<?php if ( $author_ava == 1 ): ?>
								<?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>
							<?php endif; ?>
							<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author"><span class="vcard author author_name"><span class="fn"><?php echo get_the_author(); ?></span></span></a>
						</li>
					<?php endif ?>
					<?php // Date ?>
					<?php if( $date == 1): ?><li class="meta-date"><?php echo get_the_date(); ?></li><?php endif ?>
					<?php // Categories ?>
					<?php if(get_the_category_list( ', ' ) && $cats == 1): ?>
						<li class="meta-categories"><?php echo get_the_category_list( ', ' ); ?></li>
					<?php endif; ?>
					<?php // Tags ?>
					<?php if(get_the_tag_list( '', ', ' ) && $tags == 1): ?>
						<li class="meta-tags"><?php echo get_the_tag_list( '', ', ' ); ?></li>
					<?php endif; ?>
					<?php // Comments ?>
					<?php if( $comments && comments_open() ): ?>
						<li><span class="meta-reply">
							<?php 
								$comment_link_template = '<span class="comments-count">%s</span> <span class="comments-count-label">%s</span>';
							 ?>
							<?php comments_popup_link( 
								sprintf( $comment_link_template, '0', esc_html__( 'comments', 'woodmart' ) ),
								sprintf( $comment_link_template, '1', esc_html__( 'comment', 'woodmart' ) ),
								sprintf( $comment_link_template, '%', esc_html__( 'comments', 'woodmart' ) )
							); ?>
						</span></li>
					<?php endif; ?>
					<?php // Edit link ?>
					<?php if( is_user_logged_in() && $edit == 1 ): ?>
						<!--li><?php edit_post_link( esc_html__( 'Edit', 'woodmart' ), '<span class="edit-link">', '</span>' ); ?></li-->
					<?php endif; ?>
				<?php endif; ?>
			</ul>
		<?php
	}