Các anh cho e hỏi lỗi thiếu Author và thiếu Updated thì phải giải quyết như thế nào ạ. Mà e thấy trang e giờ đã có rồi mà vẫn bị báo lỗi trong gg webmasters tools. 1.313 Mục trên 1.313 trang 1.303 Các mục bị lỗi trên 1.303 trang Mục Các mục bị lỗi 1.276 Mục Các mục bị lỗi 25/05/2015 968 954 26/05/2015 978 964 27/05/2015 995 981 28/05/2015 1.005 992 29/05/2015 1.026 1.014 30/05/2015 1.026 1.014 31/05/2015 1.056 1.043 01/06/2015 1.069 1.055 02/06/2015 1.077 1.065 03/06/2015 1.077 1.065 04/06/2015 1.096 1.083 05/06/2015 1.122 1.104 06/06/2015 1.122 1.104 07/06/2015 1.179 1.164 08/06/2015 1.179 1.164 09/06/2015 1.184 1.170 10/06/2015 1.198 1.184 11/06/2015 1.216 1.203 12/06/2015 1.221 1.209 13/06/2015 1.231 1.219 14/06/2015 1.241 1.229 15/06/2015 1.251 1.239 16/06/2015 1.254 1.242 17/06/2015 1.263 1.251 18/06/2015 1.268 1.257 20/06/2015 1.279 1.268 21/06/2015 1.286 1.276 22/06/2015 1.292 1.282 23/06/2015 1.301 1.291 24/06/2015 1.313 1.303
- Fix author: Đầu tiên thớt vào phần quản trị trang và đến phần Giao diện Appearence =>Editor => Single(.)php Tìm đoạn : Mã: <span class="theauthor"> <?php the_author_posts_link(); ?> </span> Hoặc Mã: <span class='theauthor'> <?php the_author(); ?> </span> Sửa lại thành: Mã: <span class="vcard author"> <span class="fn"> <?php the_author_posts_link(); ?> </span> </span> - Fix update: Tìm đoạn code sau : <span> <?php the_time(‘j F,Y’); ?> </span> Thêm vào thuộc tính “date updated” , khi đó code có dạng như sau : <span class=”post_date date updated”> <?php the_time(‘j F,Y’); ?> </span> Lưu ý thớt: Đối với mỗi mã nguồn sẽ có code để fix khác nhau nha. nên khi làm thì ghi rõ mã nguồn để có thể trloi chính xác được. Thân !
Chủ thớt làm theo như bạn ở trên là fix được lỗi, trong trường hợp bạn không biết rõ về code thì bạn có thể tham khảo tại đây để nhìn hình ảnh cho dễ hình dung nhất. Cơ bản cũng chỉ là thêm class còn thiếu thôi http://fivera.net/hatom-feed-hatom-entry-error-wordpress-solution/
Cho mình hỏi đây là đoạn mã nguồn tìm trong web site của mình. cũng bị 2 lỗi trên vậy fix thế nào vậy bạn. thấy nó khác với hướng dẫn nên ko dám làm. hay là mình tìm sai code. không thấy code giống của bạn. Xin cảm ơn chờ giải đáp.Mã:<div class="date-time"> <span><?php echo get_the_time('d'); ?></span> <span><?php echo get_the_time('M'); ?></span> </div> và <div class="author-info"> <span class="author"><?php the_author_posts_link();?></span> <span class="role"><?php echo ts_get_user_role( get_the_author_meta('ID') ); ?></span> <p><?php the_author_meta( 'description' ); ?></p> </div>
Loại lỗi Thiếu: author cùng bị như bạn nhưng mình tìm đoạn code đấy không thấy, rất mong các bác chỉ giúp em sửa lỗi này , đây là Single(.)php web của mình, ---------------------------- <?php /** * The template for displaying all single posts. * * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post * * @package headstart */ get_header(); ?> <?php if ( is_page_template( 'page-templates/page-sidebar-right.php' ) || get_theme_mod( 'layout_setting' ) === 'sidebar-right' ) { ?> <div id="primary" class="content-area small-12 medium-8 columns sidebar-right"> <?php } else if ( is_page_template( 'page-templates/page-sidebar-left.php' ) || get_theme_mod( 'layout_setting' ) === 'sidebar-left' ) { ?> <div id="primary" class="content-area small-12 medium-8 medium-push-4 columns sidebar-left"> <?php } else if ( is_page_template( 'page-templates/page-no-sidebar.php' ) || get_theme_mod( 'layout_setting' ) === 'no-sidebar' ) { ?> <div id="primary" class="content-area small-12 medium-10 medium-push-1 large-8 large-push-2 columns no-sidebar"> <?php } else if ( is_page_template( 'page-templates/page-full-width.php' ) ) { ?> <div id="primary" class="content-area medium-12 columns no-sidebar page-full-width"> <?php } else { ?> <div id="primary" class="content-area small-12 medium-8 columns sidebar-right"> <?php } ?> <main id="main" class="site-main" role="main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'components/post/content', get_post_format() ); headstart_post_navigation(); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : comments_template(); endif; endwhile; // End of the loop. ?> </main> </div> <?php get_sidebar(); get_footer();
Để thêm author và update, bạn dùng code này xem sao nha: <div class="entry-meta entry-meta-single entry-meta-single"> <i class="fa fa-calendar"></i> <p class="timeline-date-stamp"> <span class="entry-date" itemprop="datePublished" content="<?php the_time(get_option('date_format')); ?>"><time class="entry-date updated"><?php the_time(get_option('date_format')); ?></time></span> </p> <i class="fa fa-user" aria-hidden="true"></i> <span itemprop="author" class="author vcard"><span class="fn"> <?php $author_id = $post->post_author; echo the_author_meta( 'display_name' , $author_id ); ?> </span></span> </div> đặt sau phần này trong file single.php: <header class="entry-header"> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> </header><!-- .entry-header -->Để thêm author và update, bạn dùng code này xem sao nha: <div class="entry-meta entry-meta-single entry-meta-single"> <i class="fa fa-calendar"></i> <p class="timeline-date-stamp"> <span class="entry-date" itemprop="datePublished" content="<?php the_time(get_option('date_format')); ?>"><time class="entry-date updated"><?php the_time(get_option('date_format')); ?></time></span> </p> <i class="fa fa-user" aria-hidden="true"></i> <span itemprop="author" class="author vcard"><span class="fn"> <?php $author_id = $post->post_author; echo the_author_meta( 'display_name' , $author_id ); ?> </span></span> </div> đặt sau phần này trong file single.php: <header class="entry-header"> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> </header><!-- .entry-header -->