arbinqadeer
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Themes and Templates
In reply to: [Astra] Search shows products like blog postsI have to thank Astra forum for being not helpful at all and being so miser about helping someone out.
Luckily, there’s ChatGPT and it helped me with changing my code in search.php to:
<?php
/**
* Search results template
*
* @package Astra
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
get_header();
?>
<div id="primary" <?php astra_primary_class(); ?>>
<?php astra_primary_content_top(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header ast-archive-header">
<h1 class="page-title ast-archive-title">
<?php printf( esc_html__( 'Search Results for: %s', 'astra' ), '<span>' . get_search_query() . '</span>' ); ?>
</h1>
</header>
<div class="woocommerce columns-4">
<?php
woocommerce_product_loop_start();
while ( have_posts() ) :
the_post();
if ( 'product' === get_post_type() ) {
wc_get_template_part( 'content', 'product' );
}
endwhile;
woocommerce_product_loop_end();
?>
</div>
<?php astra_pagination(); ?>
<?php else : ?>
<header class="page-header ast-archive-header">
<h1 class="page-title ast-archive-title">
<?php printf( esc_html__( 'Search Results for: %s', 'astra' ), '<span>' . get_search_query() . '</span>' ); ?>
</h1>
</header>
<p><?php esc_html_e( 'No products found.', 'astra' ); ?></p>
<?php endif; ?>
<?php astra_primary_content_bottom(); ?>
</div><!-- #primary -->
<?php get_footer(); ?>Forum: Themes and Templates
In reply to: [Astra] Search shows products like blog postsYes. I followed those exact steps and the problem persists.
Please have a look at the setting file:
Forum: Themes and Templates
In reply to: [Astra] Search shows products like blog posts@humayonk tried every option in that setting, and it still shows it with “read more” and “posted by”. You can go to the page and see. It still doesn’t show like a product.
Viewing 3 replies - 1 through 3 (of 3 total)