How do you put the associated block across the container?



  • I have a shop on wordpress+woo trade. On the page of the goods, I want to remove a carousel with similar items, but not in the Butstrapp container, but on the whole page. Whatever position I'm putting in a standard fuck function.

    add_action('woocommerce_after_main_content', 'woocommerce_output_related_products');
    

    the same goods are removed within the container. If I write a shortcode in a fuse, I understand there's no connection to a particular item, and there's not enough of the same kind of goods to go out (and there's not enough to complete the whole page). ♪

    <?php if (is_product()); ?>  
    <section class="related-products">
       <?php echo do_shortcode ('[related_products per_page="4"]'); ?>
    </section>
    <?php endif; ?>
    

    I mean, if you take the fuck out, it's all taken out (see 8 similar goods) but in the container, and if the shortcode is all wide, but only 2 is the dilemma. ♪ How to be?



  • In fact, in my case, I found a simpler solution, found a hook for which it was possible to catch:

    add_action('footer_in_top_part','woocommerce_output_related_products',5);
    

    Maybe someone needs to.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2