add_shortcode( 'toster_latest_comments', function () {
ob_start();
$comments = get_comments('status=approve&number=5'); ?>
<ul class="widgcomm">
<?php foreach ($comments as $comment) { ?>
<li class="comcont"><?php
$title = get_the_title($comment->comment_post_ID);
echo get_avatar( $comment, $size = '35');
echo '<span class="tecom">' . ($comment->comment_author) . '';
?> к посту: </span><a class="auth" href="<?php echo get_permalink($comment->comment_post_ID); ?>"
rel="external nofollow" title="<?php echo $title; ?>">
<?php echo $title; ?> </a>
"<?php
echo '<span class="tecom">' . wp_html_excerpt( $comment->comment_content, 35 ) .
'</span>'; ?>.."
<?php $d = "M d, Y";
$comment_ID = $comment->comment_ID;
$comment_date = get_comment_date( $d, $comment_ID );
$comment_PID = $comment->comment_post_ID;
echo $comment_date;?>
<?php echo 'Всего комм.: '.get_comments_number($comment_PID) ?>
</li>
<?php } ?> </ul8 <?php
$output = ob_get_clean();
return $output;
} );
add_shortcode( 'ha_woo_stock_label', function () {
$product = wc_get_product();
ob_start();
if ( $product->is_in_stock() ) {
echo '<div class="ha-stock ha-stock--in-stock">In Stock</div>';
} else {
echo '<div class="ha-stock ha-stock--out-of-stock">Out of Stock</div>';
}
$output = ob_get_clean();
return $output;
} );
[ha_woo_stock_label]
libapache2_mod_php