add files
This commit is contained in:
96
template-parts/home/colon-item.php
Normal file
96
template-parts/home/colon-item.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<!--[home/colon-item]-->
|
||||
|
||||
<?php
|
||||
|
||||
global $main_item, $colon_item;
|
||||
|
||||
$colon_query = new WP_Query(
|
||||
[
|
||||
"post_type" => ["anew", "profile_article"],
|
||||
"post_status" => "publish",
|
||||
"meta_query" => [
|
||||
"relation" => "AND",
|
||||
[
|
||||
"key" => "colon_item",
|
||||
"value" => "true",
|
||||
"compare" => "LIKE"
|
||||
]
|
||||
],
|
||||
"posts_per_page" => 1,
|
||||
"suppress_filters" => true,
|
||||
"ignore_sticky_posts" => true,
|
||||
"order" => "DESC",
|
||||
"orderby" => "post_date"
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php if($colon_query->have_posts()): ?>
|
||||
|
||||
<?php while ($colon_query->have_posts()): ?>
|
||||
|
||||
<?php $colon_query->the_post(); ?>
|
||||
|
||||
<?php $colon_item = get_the_ID(); ?>
|
||||
|
||||
<div class="d-flex" >
|
||||
|
||||
<div class="blog"
|
||||
itemscope
|
||||
<?php if( get_post_type() == "profile_article"): ?>
|
||||
itemtype="https://schema.org/Article"
|
||||
<?php else: ?>
|
||||
itemtype="https://schema.org/NewsArticle"
|
||||
<?php endif; ?>
|
||||
>
|
||||
|
||||
<a class="blog__frame" href="<?= the_permalink() ?>">
|
||||
|
||||
<img loading="lazy"
|
||||
itemprop="image"
|
||||
class="d-block"
|
||||
src="<?= the_post_thumbnail_url( [ 264, 264 ] ); ?>"
|
||||
width="167"
|
||||
height="158"
|
||||
alt="<?= htmlspecialchars( get_the_title() ) ?>"
|
||||
/>
|
||||
|
||||
</a>
|
||||
<div class="blog__body">
|
||||
|
||||
<a class="blog__title" href="<?= the_permalink() ?>">
|
||||
|
||||
<?php if( function_exists('get_secondary_title') && get_secondary_title() ) : ?>
|
||||
|
||||
<?= the_secondary_title() ?>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<?= the_title() ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</a>
|
||||
|
||||
<?php get_template_part("template-parts/micro/post"); ?>
|
||||
|
||||
<div class="blog__detail">
|
||||
|
||||
<?php get_template_part("template-parts/post/blog-date"); ?>
|
||||
|
||||
<?php get_template_part("template-parts/post/blog-author"); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!--[/home/colon-item]-->
|
||||
Reference in New Issue
Block a user