
Stevenson, Washington and the Columbia River
Yesterday I came across a method to update your webpage or blog posts through the Wordpress interface, rather than going into the code. For example, you have a jQuery slider on your homepage, but in order to update it you have to go into the template (or page / post) and edit it there. After staying on that road for sometime, I knew there had to be an easier way to do this through the Wordpress interface, rather than diving into the code (and defeating the purpose of using Wordpress altogether).
So I stumbled onto Custom Fields. Custom Fields are those little boxes below the area where you update your post, that I’m assuming most people glance over once and never look back. After searching for a method to update the slider for a project, I found a method for doing this via Custom Fields.
Open up your Wordpress panel and make sure you know what I am talking about in the first place. Click on the picture below for confirmation.
Now that you know where Custom Fields are located, enter in a name and a value. If you’re familiar with programming, the “name” will be your variable name, and “value” will be the value of that variable. If you’re NOT familiar with programming, a variable is used as a container that holds a value (remember Algebra anyone?). You can later specify the name of the variable and the value will be displayed.
For instance, for the “name” you entered example and for the value you entered “This is the value for the field “example.” Now remember when you call example the value that you entered will be displayed, including any pictures that you decide to enter.
So now, you have to enter a php script for this value to be displayed in your post. Also, this post is meant for people that have a general understand of Php and Wordpress, but if you don’t, head on over to the Wordpress Codex and start reading up.
So find the spot where you would like your “value” of your Custom Field to be displayed and enter it, as in the picture below.
The only part you will need to change in the code is where it says $example and ‘example‘ (it is listed in three places) as this is the “name” of your custom field. If you remember, we used this as our example above. So change that to the name of your custom field.
And now you’re set to go. Feel free to enter in as many custom fields as you would like, and enter them in the same template or page and start making life a little easier on yourself.
—
I’m also very interested in hearing your opinions of this method. If you have a better option, I’m all ears.
Posted on January 16th, 2010









Do you like this article?
Related Posts