• Resolved wygaa

    (@wygaa)


    Hi, I’ve noticed quite odd issue.
    Sometimes I want to use the plugin in page template file for pages with specified layout to leave minimum content to edit.
    I use the function
    <?php echo do_shortcode("[faqs style='toggle']"); ?>

    If I will attach it in the page template file it won’t load its functions, toggle won’t work.
    However if I will attach it as it supposed to be, editable in the content section it works perfectly fine.
    Any idea how to sort it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wygaa

    (@wygaa)

    Jesus… I have spent some good time for troubleshooting.
    Apparently when adding the shortcode with gutenberg it adds container:
    <div class="wp-block-quick-and-easy-faqs-faqs-toggle">...</div>

    Which is important for the script to work but not existing by default if using only function. Great

    Hi,

    I hope you are having a good day. Thank you for reaching out about your problem.

    You can use the following function to display FAQs.

    <?php 
    $faqs = new Quick_And_Easy_FAQs\Includes\FAQs();
    echo $faqs->get_faqs_markup( 'toggle', true, 'date', 'ASC' );
    ?>

    Please keep in mind that it is a temporary solution as we do not recommend it.

    ​Feel free to let me know if you need any further assistance.

    ​Regards,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin won’t load unless it’s in the content section’ is closed to new replies.