Title: Adding variables
Last modified: August 19, 2016

---

# Adding variables

 *  810167
 * [17 years, 10 months ago](https://wordpress.org/support/topic/adding-variables/)
 * Hi,
 * I’ve setup a site listing various products and prices. Some products appear on
   multiple posts and pages therefore each time I need to update a price, I’m having
   to amend each and every entry.
 * Is it possible to either, define variables in one of my themes php pages and 
   call these variables within posts/pages or can I define variables in a WordPress(
   unpublished) page itself and again call via the other posts/pages?
 * Thanks!

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

 *  [Steven](https://wordpress.org/support/users/spstieng/)
 * (@spstieng)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/adding-variables/#post-822727)
 * You should realy have a database for this.
    I can promise you that the more products
   you get, the less controll you will have if you add them as posts.
 * I don’t see any easy way of using variables like that with wordpress.
 * Why not use e-commerse plugins?
    [http://www.google.com/search?client=opera&rls=nb&q=wordpress+shopping+cart&sourceid=opera&ie=utf-8&oe=utf-8](http://www.google.com/search?client=opera&rls=nb&q=wordpress+shopping+cart&sourceid=opera&ie=utf-8&oe=utf-8)
 *  Thread Starter 810167
 * [17 years, 10 months ago](https://wordpress.org/support/topic/adding-variables/#post-822735)
 * Hi,
 * Thanks for the reply. I thought maybe I could define a load of variables and 
   then call them. Not so easy then eh!
 *  [Steven](https://wordpress.org/support/users/spstieng/)
 * (@spstieng)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/adding-variables/#post-822738)
 * I just have a 4-5 weeks of experience with WordPress.
    When it comes to variables,
   it goes down like this:
 * You can use any variable you want for any post / page.
    The value you enter in
   that varable is only valid for that specific post / page. If you want a variable
   value from a different post / page, you first have to retrieve that post / page.
 * I would strongly suggest that you take a look at some e-commerce plugins for 
   wordpress. Will save you a lot of time and frustration 😉

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

The topic ‘Adding variables’ is closed to new replies.

## Tags

 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Steven](https://wordpress.org/support/users/spstieng/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/adding-variables/#post-822738)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
