| @@ -1,21 +1,16 @@ | ||
| 1 | -<?php | |
| 1 | +<div class="betterdocs-author-date"> | |
| 2 | + <div class="betterdocs-author"> | |
| 3 | + <?php | |
| 4 | + // Get the author's ID | |
| 5 | + $author_id = get_post_field( 'post_author', get_the_ID() ); | |
| 2 | 6 | |
| 3 | - // Get the author's ID | |
| 4 | - $author_id = get_post_field( 'post_author', get_the_ID() ); | |
| 7 | + // Get the author's avatar with a specified size | |
| 8 | + $avatar_size = 40; | |
| 9 | + $author_avatar = get_avatar( $author_id, $avatar_size ); | |
| 5 | 10 | |
| 6 | - // Get the author's avatar with a specified size | |
| 7 | - $avatar_size = 40; | |
| 8 | - $author_avatar = get_avatar( $author_id, $avatar_size ); | |
| 9 | - $authors_url = site_url() . '/' . betterdocs()->settings->get( 'docs_slug' ) . '/authors/' . $author_id . '/page/1'; | |
| 10 | - | |
| 11 | -?> | |
| 12 | - | |
| 13 | -<a class="betterdocs-author-date" href="<?php echo $authors_url; ?>"> | |
| 14 | - <div class="betterdocs-author"> | |
| 15 | - <?php | |
| 16 | - echo '<div class="author-avatar">' . $author_avatar . '</div>'; | |
| 17 | - echo '<span>' . get_the_author_meta( 'display_name', $author_id ) . '</span>'; | |
| 18 | - ?> | |
| 19 | - </div> | |
| 20 | - <?php betterdocs()->views->get( 'template-parts/update-date' );?> | |
| 21 | -</a> | |
| 11 | + echo '<div class="author-avatar">' . $author_avatar . '</div>'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 12 | + echo '<span>' . get_the_author_meta( 'display_name', $author_id ) . '</span>'; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 13 | + ?> | |
| 14 | + </div> | |
| 15 | + <?php betterdocs()->views->get( 'template-parts/update-date' ); ?> | |
| 16 | +</div> | |