I'm trying to display a description of a WooCommerce single product, but the instead of displaying the correct description, the loop starts over again displaying the image, price, add to cart etc.
I've tried to find the answer for long time with no avail.
I have used the WooCommerce template scripts and edit them; the_excerpt()
will work but not the_content(
).
This is the template file I am currently using: .php
the_content()
is now the problem. Could it be my query or something? I have different way to query my products from index.php, but the archive-product.php is having the same as WooCommerce query has. Could this be the cause, even if it's in the single-product.php the problem?
I use this for the front-page.php:s product loop:
<div class="col-9 main-products">
<?php echo do_shortcode('[products paginate="true" limit="30" orderby="popularity"]'); ?>
</div>
content-single-product.php, archive-product.php and single-product.php are the same as the WooCommerce template has.
It should display the description instead of looping over again. There are no error messages.
I've also used a different theme and the products display correctly, so the problem isn't in any plugins I am using.
I'm trying to display a description of a WooCommerce single product, but the instead of displaying the correct description, the loop starts over again displaying the image, price, add to cart etc.
I've tried to find the answer for long time with no avail.
I have used the WooCommerce template scripts and edit them; the_excerpt()
will work but not the_content(
).
This is the template file I am currently using: https://github/woocommerce/woocommerce/blob/master/templates/single-product/tabs/description.php
the_content()
is now the problem. Could it be my query or something? I have different way to query my products from index.php, but the archive-product.php is having the same as WooCommerce query has. Could this be the cause, even if it's in the single-product.php the problem?
I use this for the front-page.php:s product loop:
<div class="col-9 main-products">
<?php echo do_shortcode('[products paginate="true" limit="30" orderby="popularity"]'); ?>
</div>
content-single-product.php, archive-product.php and single-product.php are the same as the WooCommerce template has.
It should display the description instead of looping over again. There are no error messages.
I've also used a different theme and the products display correctly, so the problem isn't in any plugins I am using.
Share Improve this question edited Jun 17, 2019 at 12:27 Timppa asked Jun 17, 2019 at 8:35 TimppaTimppa 1016 bronze badges1 Answer
Reset to default 0echo wpautop(get_the_content());
This code fixed the problem! I found out the solution from here: Post content being duplicated by the_content(); by KreigD's answer.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745391901a4625699.html
评论列表(0条)