Title: Trouble with old shortcode
Last modified: August 30, 2016

---

# Trouble with old shortcode

 *  Resolved [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * (@aurorasentinel1)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/)
 * I had been using code below. Now the link doesn’t work. Been trying everything
   but can’t get it to roll. Can anyone help?
 * `<h5>[loop type="post" id="311" count="1"]<a href="[content field='url']"> [content
   field="image"] [content field="employee-name"], <br/>[content field="employee-
   title"]</a>[/loop]</h5>`
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

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

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424168)
 * 1) Are you using this code inside the current post’s content (in text editor),
   or loading it from another post using shortcode or PHP?
 * 2) It sounds like the specific issue is that the URL inside the link doesn’t 
   point correctly. Is it linking to the current post instead of each post in the
   loop? Or is the URL empty?
 * 3) It could be related to using “quotes”. Your code could be written without 
   quotes, like this:
 *     ```
       <h5>[loop type=post id=311 count=1]<a href="[field url]"> [field image] [field employee-name], <br/>[field employee-title]</a>[/loop]</h5>
       ```
   
 * Does that make any difference?
 *  Thread Starter [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * (@aurorasentinel1)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424186)
 * 1. I’m not inside the current post content. I use the Pagelines DMS framework.
   It’s in a drag and drop text box. The old shortcake was working fine before all
   of the updates started.
    2. Hovering over the link shows it is linking to the
   current post, not the correct post id. 3.Quotes made no difference.
 * I tried using the [field image-link] and that yielded the correct results. So
   it is picking up the correct id. Those other fields are ACF so there is no alternative
   like title-link.
 *  Thread Starter [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * (@aurorasentinel1)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424207)
 * So I tried this:
    `<h5>[loop type=post id=339 count=1]<a href=[content field=
   url]>[content field=image] [content field=employee-name], <br/>[content field
   =employee-title]</a>[/loop]</h5>`
 * and I get a 404 error with this url: [http://leapmediaserv.staging.wpengine.com/people/%5Bcontent](http://leapmediaserv.staging.wpengine.com/people/%5Bcontent)
 * I see something in your documentation about an escape parameter. Does that come
   into play here?
 *  Thread Starter [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * (@aurorasentinel1)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424221)
 * And if I drop the code from above into the post content it works! But I need 
   to drop it into a text box. Is there a solution for that?
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424352)
 * Hello,
 * I believe this is due to the change in WP 4.2.3, that shortcodes inside HTML 
   attributes are removed. To get around this, I added a new shortcode `[link]` 
   to create a link from a field value. By default it will link to the current post
   in the loop.
 *     ```
       <h5>[loop type=post id=311][link][field image] [field employee-name], <br/>[field employee-title][/link][/loop]</h5>
       ```
   
 * For details, please see the documentation under Main Features -> Field -> Link
   to Field Value.
 *  Thread Starter [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * (@aurorasentinel1)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424371)
 * Perfect! Thanks so much.

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

The topic ‘Trouble with old shortcode’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [aurorasentinel1](https://wordpress.org/support/users/aurorasentinel1/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-old-shortcode/#post-6424371)
 * Status: resolved