• Resolved Chuwi

    (@avidal7)


    Hi!, first of all many thanks for the plugin and also thanks in advance for the support!

    The site I’m managing is using ACF and the way it’s done is forcing me to use php templates for the page I want to host your Pretty Google Calendar.

    Is it possible to include or call the code snippet from php?, how it should be done to use the parameters I want to use?

    <code> [pretty_google_calendar gcal="[email protected]" locale="es"?show_title="true" use_tooltip="true" list_type="listCustom" custom_days="60" ] </code>

    In ACF I’m using WYSIWIG Editor Field but I don’t know if there is another kind of Field I could use to properly embed the calendar to avoid the use of PHP.

    Thanks again, and pretty great job you are doing!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author LBell

    (@lbell)

    To call any shortcode via a php template file, you need to use do_shortcode() like so:

    <?php echo do_shortcode("[your_shortcode]"); ?>

    Thread Starter Chuwi

    (@avidal7)

    Easy, fast and works like a charm, thanks!
    You solved my doubt easily after hours looking for the solution, seems like I didn’t know how to google it ??

    Worth mentioning that I needed to replace double quotes with single quotes in my code section to avoid issues, so finally my code is like this one:

    echo do_shortcode("[pretty_google_calendar gcal='[email protected]' locale='es'?show_title='true' use_tooltip='true' list_type='listCustom' custom_days=60']");

    Thanks a lot again and keep it up!

    Plugin Author LBell

    (@lbell)

    Yup, the single-double quote thing in an echo can be annoying. Glad you got it sorted!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to call code snippet from PHP’ is closed to new replies.