Written by Anonymous
<?php //新着記事、ナビカードウィジェット
/**
* Cocoon WordPress Theme
* @author: yhira
* @link: https://wp-cocoon.com/
* @license: http://www.gnu.org/licenses/gpl-2.0.html GPL v2 or later
*/
if ( !defined( 'ABSPATH' ) ) exit;
$prefix = $args['prefix'] ?? '';
$url = $args['url'] ?? '';
$title = $args['title'] ?? '';
$snippet = $args['snippet'] ?? '';
$date = $args['date'] ?? '';
$thumb_size = $args['thumb_size'] ?? '';
$image_attributes = $args['image_attributes'] ?? '';
$ribbon_no = $args['ribbon_no'] ?? '';
$type = $args['type'] ?? '';
$classes = $args['classes'] ?? '';
$object = $args['object'] ?? '';
$object_id = $args['object_id'] ?? '';
$horizontal = $args['horizontal'] ?? '';
$target = $args['target'] ?? '';
$class_text = $args['class_text'] ?? '';
$ribbon_tag = $args['ribbon_tag'] ?? '';
$swiper_slide = $args['swiper_slide'] ?? '';
$div_class = $args['div_class'] ?? '';
$target_attr = $args['target_attr'] ?? '';
?>
<a href="<?php echo esc_url($url); ?>"
class="<?php echo $prefix; ?>-entry-card-link widget-entry-card-link a-wrap<?php echo $class_text; ?><?php echo $swiper_slide; ?>"
title="<?php echo esc_attr(escape_shortcodes($title)); ?>"
<?php echo $target_attr; ?>>
<div <?php echo $div_class; ?>>
<?php echo $ribbon_tag; ?>
<figure class="<?php echo $prefix; ?>xx-entry-card-thumb widget-entry-card-thumb card-thumb">
<?php
if (is_widget_navi_entry_card_prefix($prefix)) {
$class = 'navi-entry-card-image widget-entry-card-image card-thumb';
$post_types = get_custum_post_types();
if ($object === 'post' || $object === 'page' || in_array($object, $post_types)) {
$size = ($type === ET_DEFAULT) ? THUMB120 : THUMB320;
$attr = array('class' => $class);
$thumbnail_tag = get_the_post_thumbnail($object_id, $size, $attr);
echo $thumbnail_tag ?: get_widget_entry_card_no_image_tag(ET_DEFAULT, $prefix);
} else {
if ($object === 'category') {
$class = 'category-image ' . $class;
if (!get_the_category_eye_catch_url($object_id)) {
$class = 'no-image ' . $class;
}
}
echo get_navi_entry_card_thumbnail_tag($image_attributes, $title, $class);
}
} else {
echo get_widget_entry_card_thumbnail_tag($prefix, $thumb_size, $type);
}
?>
</figure>
<div class="<?php echo $prefix; ?>-entry-card-content widget-entry-card-content card-content">
<div class="<?php echo $prefix; ?>-entry-card-title widget-entry-card-title card-title">
<?php echo $title; ?>
</div>
<?php if ($snippet): ?>
<div class="<?php echo $prefix; ?>-entry-card-snippet widget-entry-card-snippet card-snippet">
<?php echo $snippet; ?>
</div>
<?php endif; ?>
<?php
if (!is_widget_navi_entry_card_prefix($prefix)) {
generate_widget_entry_card_date($prefix, null, $display = $date);
}
?>
</div>
</div>
</a>