Title: Append to a variable
Last modified: April 16, 2021

---

# Append to a variable

 *  Resolved [s1s2](https://wordpress.org/support/users/s1s2/)
 * (@s1s2)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/append-to-a-variable/)
 * Is there any way to append content to a variable via CCS shortcodes?
 * For example:
 *     ```
       [set variablex]A[/set]
       [loop count=5]
        [set variablex]variable x + "and B"[/set]
       [/loop]
       ```
   
 * I made up the syntax of the 3rd line, but is there’s an actual syntax I can use
   to append something to a string?
 * Thanks!

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

 *  [iantresman](https://wordpress.org/support/users/iantresman/)
 * (@iantresman)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/append-to-a-variable/#post-14327911)
 * Try:
 *     ```
       [set variablex]A[/set]
       [loop count=5]
         [set variablex][get variablex] and B[/set]
         variable x = [get variablex]
       [/loop]
       ```
   
 * Shows:
 *     ```
       variable x = A and B
       variable x = A and B and B
       variable x = A and B and B and B
       variable x = A and B and B and B and B
       variable x = A and B and B and B and B and B
       ```
   
 *  Thread Starter [s1s2](https://wordpress.org/support/users/s1s2/)
 * (@s1s2)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/append-to-a-variable/#post-14328974)
 * That’s perfect, thanks!

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

The topic ‘Append to a variable’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [s1s2](https://wordpress.org/support/users/s1s2/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/append-to-a-variable/#post-14328974)
 * Status: resolved