Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1097605
    rotipom
    Participant

    I’m trying to understand if I can insert an Accordion Shortcode that is already pre-filled with my desired content (in this case FAQ) anywhere I like?

    I manage to insert it into Woocommerce Product Page but I don’t want to have to type a new one for each product. I want to just add the shortcode and all the FAQ content is pulled up?

    http://www.amytwon.com/product/labyrinth-expedition-kit/

    Accordion

    #1097668
    rotipom
    Participant

    I managed to add the shortcode using a roundabout method -create the accordion FAQ block in a regular page using cornerstone, and then copy the code and paste it in woocommerce single product page.

    http://www.amytwon.com/product/labyrinth-expedition-kit/

    This means that I’m having to copy and paste the full code for each product. Is there a way to reference that accordian block using shortcode without individually pasting the full code in every product page?

    #1098061
    Friech
    Moderator

    Hi There,

    Thanks for writing in! You can add this on your child theme’s functions.php file.

    add_action( 'woocommerce_before_add_to_cart_form', 'add_to_single_product_summary' );
    function add_to_single_product_summary() {
      echo do_shortcode( '
    
        /*REPLACE THIS WITH YOUR SHORTCODE*/
    
        ' );    
    }
    
    

    Hope it helps, Cheers!

  • <script> jQuery(function($){ $("#no-reply-1097605 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>