admin管理员组文章数量:1388140
Where exactly in the file structure can I find and edit the markup so that I remove that a href within the thumbnail and product title. I tried searching the template files but can't seem to find it. It's calling or echoing this template part (<?php wc_get_template_part( 'content', 'product' ); ?>)
but there wasn't any markup showing the thumbnail or product title.
<?php
$args = array(
'post_type' => 'product',
'post_per_page' => 12,
);
$crate_products = new WP_Query ( $args );
if ( $crate_products->have_posts() ) : while ( $crate_products->have_posts() ) :
$crate_products->the_post();
?>
<div class="three columns">
<?php wc_get_template_part( 'content', 'product' ); ?>
</div>
<?php wp_reset_postdata(); ?>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
Where exactly in the file structure can I find and edit the markup so that I remove that a href within the thumbnail and product title. I tried searching the template files but can't seem to find it. It's calling or echoing this template part (<?php wc_get_template_part( 'content', 'product' ); ?>)
but there wasn't any markup showing the thumbnail or product title.
<?php
$args = array(
'post_type' => 'product',
'post_per_page' => 12,
);
$crate_products = new WP_Query ( $args );
if ( $crate_products->have_posts() ) : while ( $crate_products->have_posts() ) :
$crate_products->the_post();
?>
<div class="three columns">
<?php wc_get_template_part( 'content', 'product' ); ?>
</div>
<?php wp_reset_postdata(); ?>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
Share
Improve this question
asked Apr 20, 2016 at 9:11
clestcruzclestcruz
2011 gold badge6 silver badges13 bronze badges
1 Answer
Reset to default 1It's a bit hard to tell without knowing what shop theme you are using but I'll try anyways…
The code <?php wc_get_template_part( 'content', 'product' ); ?>
is basically calling the template file content-product.php
. I would however not recommend you alter the default file.
On a standard woocommerce install you will find that default template file in the templates directory of woocommerce. If you have a theme installed that is woocommerce aware, chances are that you will also find a file content-product.php
inside the theme directory. I would strongly recommend you use a child theme to override that file.
Depending on what theme you are using the code my vary – but at least inside the default woocommerce template file content-product.php
you'll find the shop loop – and inside that loop the link tag beginning like this:
<a href="<?php the_permalink(); ?>">
Depending on the theme you use you might have to digg a bit deeper since at least the default template file puts a link around every loop item (product). A.f.a.i.k. both the thumbnail and the product title are then rendered through seperate actions…
本文标签: e commerceRemove the link from the thumbnail and product title on woocommerce
版权声明:本文标题:e commerce - Remove the link from the thumbnail and product title on woocommerce 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744568819a2613215.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论