File: /home/storage/5/78/dd/wicomm2/public_html/drogal/template-parts/content-none.php
<?php
/**
* Template part for displaying a message that posts cannot be found
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package _s
*/
?>
<section class="no-results not-found">
<div class="wc-categoria-search">
<?php dynamic_sidebar('busca_categoria'); ?>
</div>
<h2 class="wc-category-post-lestest__title grey">
<?php
/* translators: %s: search query. */
printf(esc_html__('Resultados para:%s', '_s'), '<span>' . get_search_query() . '</span>');
?>
</h2>
<div class="page-content">
<?php
if (is_home() && current_user_can('publish_posts')):
printf(
'<p>' . wp_kses(
/* translators: 1: link to WP admin new post page. */
__('Ready to publish your first post? <a href="%1$s">Get started here</a>.', '_s'),
array(
'a' => array(
'href' => array(),
),
)
) . '</p>',
esc_url(admin_url('post-new.php'))
);
elseif (is_search()):
?>
<img src="<?= get_stylesheet_directory_uri() ?>/assets/img/27083.png" class="wc-empty-search-img" />
<h2 class="wc-empty-search-title">Ops, nada por aqui...</h2>
<p class="wc-empty-search-text">
Não encontramos os resultados para sua busca. Que tal explorar outros assuntos?
</p>
<?php
endif;
?>
<section class="wc-home-category">
<h2>Sobre qual assunto você gostaria de ler hoje?</h2>
<?php
$args = array(
'post_type' => 'carrossel_categoria',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC'
);
$categorias = new WP_Query($args);
if ($categorias->have_posts()):
echo '<ul class="wc-category-list">';
while ($categorias->have_posts()):
$categorias->the_post();
$link = get_post_meta(get_the_ID(), '_wc_categoria_link', true);
$imagem = get_the_post_thumbnail_url(get_the_ID(), 'medium');
?>
<li class="wc-category-item">
<a href="<?php echo esc_url($link ?: '#'); ?>">
<?php if ($imagem): ?>
<img src="<?php echo esc_url($imagem); ?>" alt="<?php the_title_attribute(); ?>" class="wc-category-image" />
<?php else: ?>
<div class="wc-category-image placeholder"></div>
<?php endif; ?>
<span class="wc-category-title"><?php the_title(); ?></span>
</a>
</li>
<?php
endwhile;
echo '</ul>';
wp_reset_postdata();
else:
echo '<p>Nenhuma categoria cadastrada ainda.</p>';
endif;
?>
</section>
</div><!-- .page-content -->
</section><!-- .no-results -->