| Server IP : 14.225.216.240 / Your IP : 216.73.216.26 Web Server : nginx/1.20.1 System : Linux localhost.localdomain 5.14.0-596.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 27 16:02:33 UTC 2025 x86_64 User : taidh ( 1001) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/taidh/papacafe.vn/wp-content/themes/papacafe/patterns/ |
Upload File : |
<?php
/**
* Title: Business home
* Slug: papacafe/page-home-business
* Categories: papacafe_page
* Keywords: starter
* Block Types: core/post-content
* Post Types: page, wp_template
* Viewport width: 1400
* Description: A business home page with a hero section, a text section, a services section, a team section, a clients section, a FAQ section, and a CTA section.
*/
?>
<main role="main">
<?php
if (is_active_sidebar('custom-widget-area')) {
dynamic_sidebar('custom-widget-area');
}
?>
<section class="blog-section pt-100 pb-100">
<div class="container">
<div class="section-heading text-center">
<h2 class="section-title mb-0">Nhật ký hành trình</h2>
</div>
<div class="row gy-lg-0 gy-4 justify-content-center">
<?php
// Query lấy custom post type 'blog'
$args = array(
'post_type' => 'blog', // Custom post type
'posts_per_page' => 6, // Số lượng bài viết muốn hiển thị
);
$blog_query = new WP_Query($args);
// Bắt đầu vòng lặp
if ($blog_query->have_posts()) :
while ($blog_query->have_posts()) : $blog_query->the_post();
?>
<div class="col-lg-4 col-md-6">
<div class="post-card" style="--rr-color-theme-primary: #885B3A">
<div class="post-thumb">
<img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="<?php the_title(); ?>" loading="lazy">
</div>
<div class="post-content-wrap">
<div class="post-content">
<ul class="post-meta">
<li><i class="fa-sharp fa-solid fa-calendar-days"></i><?php echo get_the_date(); ?></li>
<li><i class="fa-regular fa-user"></i><?php the_author(); ?></li>
</ul>
<h3 class="title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h3>
<span class="text-truncate-3"><?php the_excerpt(); ?></span>
</div>
<div class="post-bottom">
<a class="read-more" href="<?php the_permalink(); ?>">Xem thêm<i class="fa-solid fa-arrow-right"></i></a>
</div>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata(); // Reset query về mặc định
else :
echo '<p>Không có bài viết nào.</p>';
endif;
?>
</div>
</div>
</section>
</main>