WordPress-帖子缩略图旁边出现奇怪的符号

时间:2018-12-01 10:15:47

标签: php wordpress thumbnails

对不起,我觉得这是个白痴问题,但是我无法解决,这些字符">出现在帖子缩略图旁边,我不知道那里出了什么问题!

<?php 
$notification_id = $notification->ID;
$notification_time = strtotime($notification->post_date);
$type = get_post_meta($notification_id, 'dw_notification_type', true);
$custom_type = get_post_meta($notification_id, 'dw_notification_custom_type', true);
$image = get_post_meta($notification_id, 'dw_notification_image', true);
?>

<li id="dw-notif-<?php echo $notification_id;?>" class="<?php echo dwnotif_check_user_read(false, $notification_id)?'read':'unread'; ?> <?php echo $type?$type:''; ?> <?php echo $custom_type?$custom_type:''; ?>" data-time="<?php echo $notification_time;?>">
    <a href="<?php echo get_permalink($notification->ID);?>">
        <div class="notif-avatar">
            <?php if(has_post_thumbnail($notification->ID)): ?>
                <?php echo get_the_post_thumbnail($notification->ID, 'post-thumbnail'); ?>
            <?php elseif($image): ?>
                <img src="<?php echo $image; ?>">
            <?php else: ?>
                <img src="<?php echo dwnotif_default_image(); ?>">
            <?php endif; ?>
        </div>
        <div><?php echo $notification->post_title; ?></div>
        <date class="notif-time"><?php echo human_time_diff( $notification_time, current_time('timestamp') ) . __( ' ago', 'dw-notifications' ); ?></date>
    </a>
</li>

0 个答案:

没有答案