Title: Using shortcode with advanced custom field
Last modified: February 10, 2019

---

# Using shortcode with advanced custom field

 *  Resolved [seanchk](https://wordpress.org/support/users/seanchk/)
 * (@seanchk)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/using-shortcode-with-advanced-custom-field/)
 * I have a site and each post has an ics link in a custom field.
 * How do I get that ics link from the custom field into the shortcode?
 * Thanks,
 * Sean

Viewing 1 replies (of 1 total)

 *  Plugin Author [Room 34 Creative Services, LLC](https://wordpress.org/support/users/room34/)
 * (@room34)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/using-shortcode-with-advanced-custom-field/#post-11189990)
 * I’m not quite sure I understand what you’re trying to do, but if you have the
   ICS link, you should just paste it into the `url` attribute of the shortcode.
 * If you’re talking about putting the shortcode into your post template so the 
   calendar gets inserted in the page automatically, just using the URL that’s in
   your custom field, then you’d want to do something like this… (I’m assuming here
   that you’re using Advanced Custom Fields… if not, replace `get_field('…')` with
   the method you typically use to get the value of the custom field.)
 * `<?php echo do_shortcode('[ics_calendar url="' . get_field('…') . '"]'); ?>`
 * Replace `…` with the name of your custom field.
 * If you haven’t used `do_shortcode` before, you’re basically just putting the 
   shortcode text string into the function as the first input parameter. I’ve omitted
   any of the other attributes here, but you can add any of the regular ones from
   the plugin here… `title`, `description`, `view`, etc.
    -  This reply was modified 7 years, 4 months ago by [Room 34 Creative Services, LLC](https://wordpress.org/support/users/room34/).

Viewing 1 replies (of 1 total)

The topic ‘Using shortcode with advanced custom field’ is closed to new replies.

 * ![](https://ps.w.org/ics-calendar/assets/icon.svg?rev=3427980)
 * [ICS Calendar](https://wordpress.org/plugins/ics-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ics-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ics-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/ics-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ics-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ics-calendar/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Room 34 Creative Services, LLC](https://wordpress.org/support/users/room34/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/using-shortcode-with-advanced-custom-field/#post-11189990)
 * Status: resolved