Title: Custom Template Shortcode not working
Last modified: August 24, 2016

---

# Custom Template Shortcode not working

 *  Resolved [ckone](https://wordpress.org/support/users/ckone/)
 * (@ckone)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/)
 * I have created template shortcode called “extension” i.e. [extension]
 * When I place this shortcode in the loop, so that
 * > <table>
   >  [staff_loop]
   >  <tr> <td width=”180px”>[name]</td> <td width=”210px”>[position]
   > </td> <td width=”90px”>[extension]</td> <td width=”200px”>[email_link]</td>
   > </tr> [/staff_loop]
   > </table>
 * Name, Position, email link work fine…but extension just shows up as [extension]
 * I have tried to create new shortcodes, delete old ones and create another…nothing
   works. If this information helps, some staff members do not have extension filled
   in (as in blank). If one member has blank field does it not show for all?
 * If you can direct me to somewhere to start I’d appreciate it.
 * Thanks.
 * [https://wordpress.org/plugins/staff-directory/](https://wordpress.org/plugins/staff-directory/)

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

 *  [Christopher](https://wordpress.org/support/users/christopher117/)
 * (@christopher117)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165833)
 * i have a similar issue, after the content block which is [Bio_Paragraph]
    with
   the list of the custom added input boxes, the first ofthem, which is position,
   works but then the rest show their short codes. if i change it around and put
   another one first then it does the same thing, my staff name and the picture 
   work fine and then the first custom input block
 * i need a fix for this soon as it is urgent
 *  [Christopher](https://wordpress.org/support/users/christopher117/)
 * (@christopher117)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165840)
 * i am finding that it is failing to pick up any additional shortcodes after the
   first one for the custom short codes. i have made my own grid template so i can
   display more and the order i want, and it works but i can see it pulling the 
   shortcodes i have added because it only reads the first shortcode and none of
   the others, i do not know how to fix this it will not repeat the code to read
   the shortcode and put the value instead for the loop
 *  Thread Starter [ckone](https://wordpress.org/support/users/ckone/)
 * (@ckone)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165924)
 * Any progress on this issue? Is there anything I can do to help troubleshooting
   this, other than posted?
 *  [wedemire](https://wordpress.org/support/users/wedemire/)
 * (@wedemire)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165960)
 * I was also having this issue as the updated plugin crippled my staff directory
   customization I had made.
 * I found a temporary workaround.
 * If you edit:
    /wp-content/plugins/staff-directory/classes/staff_directory_shortcode.
   php
 * Line 290 and 291 and add the shortcode values you want to the arrays.
    i.e. $
   accepted_single_tags = array(“[name]”, “[photo_url]”, “[bio]”, “[category]”, “[
   phone_number]”, “[email]”);
 * $replace_single_values = array($staff_name, $photo_url, $staff_bio, $staff_category,
   $staff_phone_number, $staff_email);
 * I added E-Mail and Phone Number.
 * This will only work for the variable listed between lines 276 to 281. If you 
   want different variables I would suggest adding more lines after 281.
 * i.e. for extension
    $staff_extension = get_post_meta(get_the_ID(), ‘extension’,
   true); That should let you add [extension] and $staff_extension to the array 
   in 290/291
 * Of course these will break if you upgrade the plugin.
 *  Plugin Author [adamtootle](https://wordpress.org/support/users/adamtootle/)
 * (@adamtootle)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165966)
 * Hey guys, I’m on vacation right now. I’m going to try to take a look at this 
   over the next couple of days and will post back if I can recreate it and find
   a fix. Sorry for the issue. Just wanted to let you guys know I have seen this
   and will see if I can find a fix as soon as I can.
 *  Thread Starter [ckone](https://wordpress.org/support/users/ckone/)
 * (@ckone)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165981)
 * Your update 1.0.1 worked like a charm! Thank you so much.
 *  [Christopher](https://wordpress.org/support/users/christopher117/)
 * (@christopher117)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165983)
 * Thank you so much from me as well
 *  Plugin Author [adamtootle](https://wordpress.org/support/users/adamtootle/)
 * (@adamtootle)
 * [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165995)
 * Glad it’s working now guys. Thanks for letting me know and thanks for the feedback!

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

The topic ‘Custom Template Shortcode not working’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/staff-directory_a19d9e.svg)
 * [Staff Directory](https://wordpress.org/plugins/staff-directory/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/staff-directory/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/staff-directory/)
 * [Active Topics](https://wordpress.org/support/plugin/staff-directory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/staff-directory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/staff-directory/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [adamtootle](https://wordpress.org/support/users/adamtootle/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/custom-template-shortcode-not-working/#post-6165995)
 * Status: resolved