✏️ 正在编辑: blog-content-3.php
路径:
/home/h359620/public_html/wp-content/themes/datis/template-parts/blog/content/blog-content-3.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php defined('ABSPATH') || exit; $post_id = get_the_ID(); $permalink = get_permalink($post_id); $title = get_the_title($post_id); // تصویر شاخص $thumb_url = get_the_post_thumbnail_url($post_id, 'large'); if ( ! $thumb_url ) { $thumb_url = 'https://placehold.co/300x250'; } // دستهبندی (اولین دسته) $cat_name = ''; $cats = get_the_category($post_id); if ( ! empty($cats) && ! is_wp_error($cats) ) { $cat_name = $cats[0]->name; // (داینامیک) نام دسته از دیتابیس میاد } // تعداد نظرات $comments_count = (int) get_comments_number($post_id); $comments_label = sprintf( /* translators: %d: comments count */ _n('%d comment', '%d comments', $comments_count, 'datis'), $comments_count ); ?> <article class="datis-blog-card style-3"> <a href="<?php echo esc_url($permalink); ?>" class="card-link" aria-label="<?php echo esc_attr__('Open post', 'datis'); ?>"></a> <div class="card-media"> <img class="card-image" src="<?php echo esc_url($thumb_url); ?>" alt="<?php echo esc_attr($title); ?>" /> </div> <div class="card-tags"> <?php if ( $cat_name ) : ?> <span class="card-tag tag-primary"> <?php echo esc_html($cat_name); ?> </span> <?php endif; ?> <span class="card-tag tag-light"> <span class="tag-text"> <?php echo esc_html($comments_label); ?> </span> <span class="tag-icon" aria-hidden="true"> <!-- chat icon --> <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M10.5 5.30269C9.61748 4.79218 8.59286 4.5 7.5 4.5C4.18629 4.5 1.5 7.18629 1.5 10.5C1.5 11.4598 1.72537 12.367 2.12608 13.1715C2.23256 13.3853 2.26801 13.6296 2.20627 13.8604L1.84891 15.196C1.69377 15.7758 2.22421 16.3062 2.80401 16.1511L4.13963 15.7937C4.37036 15.732 4.61472 15.7674 4.82852 15.8739C5.63302 16.2746 6.54019 16.5 7.5 16.5C10.8137 16.5 13.5 13.8137 13.5 10.5C13.5 9.40714 13.2078 8.38252 12.6973 7.5" stroke="#E63946" stroke-width="1.23483" stroke-linecap="round" /> <path d="M13.5 10.8764C13.5499 10.8556 13.5993 10.834 13.6483 10.8116C13.9199 10.6876 14.2246 10.6412 14.513 10.7183L14.87 10.8139C15.5947 11.0078 16.2578 10.3447 16.0639 9.61999L15.9683 9.26296C15.8912 8.97455 15.9376 8.66986 16.0616 8.39829C16.3431 7.78199 16.5 7.09681 16.5 6.375C16.5 5.41944 16.2251 4.52809 15.75 3.77574M7.125 4.4967C7.86046 2.73674 9.5983 1.5 11.625 1.5C12.5915 1.5 13.4923 1.78125 14.25 2.26636" stroke="#E63946" stroke-width="1.23483" stroke-linecap="round" /> <path d="M4.88883 10.5H4.89558M7.50687 10.5H7.51362M10.1251 10.5H10.1319" stroke="#E63946" stroke-width="1.64645" stroke-linecap="round" stroke-linejoin="round" /> </svg> </span> </span> </div> <div class="card-body"> <h3 class="card-title"> <?php echo esc_html($title); ?> </h3> <div class="card-divider"></div> <div class="card-footer"> <span class="card-arrow" aria-hidden="true"> <!-- arrow down-left --> <svg width="29" height="29" viewBox="0 0 29 29" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M18.8562 18.8568L17.383 17.3837M9.42807 9.42873L16.4991 9.42873M9.42807 9.42873L9.42807 16.4998M9.42807 9.42873L15.6153 15.6159" stroke="#E63946" stroke-width="1.37204" stroke-linecap="round" stroke-linejoin="round" /> </svg> </span> <span class="card-more"> <?php echo esc_html__('Read more', 'datis'); ?> </span> </div> </div> </article>
💾 保存文件
← 返回文件管理器