Title: shortcode not working inside input field value
Last modified: September 1, 2016

---

# shortcode not working inside input field value

 *  [kingpinzs](https://wordpress.org/support/users/kingpinzs/)
 * (@kingpinzs)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/shortcode-not-working-inside-input-field-value/)
 * example code on page
    `<input placeholder="20" name="distance" type="text" value
   ="[qv var=distance]" />`
 * example code in functions.php file
 *     ```
       function get_qv($atts)
       {
           return get_query_var($atts['var']);
       }
   
       add_shortcode('qv', 'get_qv');
   
       add_filter('query_vars', 'custom_query_vars');
       ```
   
 * but this
    `[qv var=distance]` is showing on the page to the end user. I have 
   been looking for ways to fix it.
 * I found this
 * “As such you should use your snippet to output the full value parameter (value
   =”xyz”), or the entire input itself.”
 * no idea what that means.
 * Any ideas?
    Thanks

Viewing 1 replies (of 1 total)

 *  [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * (@hardeepasrani)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/shortcode-not-working-inside-input-field-value/#post-7535741)
 * Hi,
 * Did you put this:
 * `<input placeholder="20" name="distance" type="text" value="[qv var=distance]"/
   >`
 * in your posts/pages or in a PHP page? If inside a page template then you will
   have to use [do_shortcode](https://developer.wordpress.org/reference/functions/do_shortcode/)
 * Hope it works. 🙂

Viewing 1 replies (of 1 total)

The topic ‘shortcode not working inside input field value’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Hardeep Asrani](https://wordpress.org/support/users/hardeepasrani/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/shortcode-not-working-inside-input-field-value/#post-7535741)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
