| 1 |
<div class="betterdocs-title-excerpt-lists"> |
| 2 |
<?php |
| 3 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
$custom_icon = betterdocs()->customizer->defaults->get( 'betterdocs_archive_list_icon' ); |
| 8 |
$settings_list_icon = betterdocs()->settings->get( 'docs_list_icon' ); |
| 9 |
if ( ! $custom_icon && $settings_list_icon ) { |
| 10 |
$custom_icon = $settings_list_icon["url"]; |
| 11 |
} |
| 12 |
|
| 13 |
if ( $post_query->have_posts() ): |
| 14 |
while ( $post_query->have_posts() ): $post_query->the_post(); |
| 15 |
?> |
| 16 |
<div class="betterdocs-title-excerpt-list"> |
| 17 |
<h2 class="betterdocs-entry-title"> |
| 18 |
<span><?php betterdocs()->template_helper->icon( 'docs-icon', true ); ?></span> |
| 19 |
<a href="<?php echo esc_url( get_the_permalink() ); ?>"> |
| 20 |
<?php echo esc_html( get_the_title() ); ?> |
| 21 |
</a> |
| 22 |
</h2> |
| 23 |
<?php |
| 24 |
echo wp_sprintf( '<span class="update-date">%s %s</span>', esc_html__( 'Last Updated:', 'betterdocs' ), esc_html( get_the_modified_date() ) ); |
| 25 |
|
| 26 |
add_filter('excerpt_more', function() { |
| 27 |
return '...'; // Replace '[…]' with '...' |
| 28 |
}); |
| 29 |
|
| 30 |
echo '<p>' . esc_html( get_the_excerpt() ) . '</p>'; |
| 31 |
|
| 32 |
remove_filter('excerpt_more', '__return_empty_string'); |
| 33 |
?> |
| 34 |
</div> |
| 35 |
<?php |
| 36 |
endwhile; |
| 37 |
wp_reset_postdata(); |
| 38 |
endif; |
| 39 |
?> |
| 40 |
</div> |
| 41 |
|