Hey Guys! How are you doing? This is Subbu
from bloggingmypassion.com and welcome to
the custom fields wordpress tutorial.
Normally wordpress provides two default fields
when you make a post and they are title and
description.
If you want to have a wordpress custom field
in your blog or site, for example you want
to enter some phone number so you want to
have a new text field or you want to enter
some address so you want to have a new text
area, you can add these custom fields in wordpress
by using advanced custom fields wordpress
plugin.
So in this custom fields wordpress tutorial,
I am going to show you how to use advanced
custom fields wordpress plugin and how to
add these custom fields in wordpress to your
blog posts or pages.
I am also going to show you how to add these
newly added custom fields in your posts or
pages.
So watch this video.
Normally if you want to add a new post or
a page the default fields that you will see
are the title field and the editor field.
The title field, you know, you can add the
title here and in the editor you can add the
article you want to post and publish the post.
These are the only default fields here and
if you want to have any extra fields like
phone number, like you know, like a text field
for capturing a phone number or you know a
text area field for capturing address etc.,
then you can do it with a plugin called advanced
custom fields plugin.
Using the advanced custom fields plugin you
can add any number of fields like you know
below this content or below the title that
means above the content like you know you
can have any number of fields and different
types of fields like text field, text area
etc., using this plugin.
Not only on posts, you know, there are different
options,like you know, on pages or only on
some category posts etc., you can use this
plugin and you can easily add the new fields
here and I will show you how to do that one.
For doing this one, first you have to install
the plugin so go to plugins and click on add
new.
In the search box search with the words advanced
custom fields. Search plugins.
This is the plugin that we are going to use.
Click on install now.
"Are you sure you want to install this plugin?",
yes, click on "Ok".
Now the plugin is installed and click activate
plugin to activate the plugin.
Ok, now the plugin is activated and you can
see the plugin under installed plugins section
and once the plugin is activated, you will
a new menu item called "Custom Fields" on
the left side menu.
so,click on custom fields.
So once u click on custom fields like you
know this is the page that will be shown up
and here you will see something called field
groups.
So the first thing you have to do is you have
to add a field group.
So what is a field group?
A field group is nothing but a group of fields.that
means what are the fields u want to add like
txt field,txt area radio buttons etc.you will
group them as one field group.
so this is called a field group.
so first thing u have to do is u have to do
add a new field group.
so click on add new here.
so once u click on add new field group so
the first thing is to give a a new name here
for this purpose what I am doing is I am giving
it as test field group.
secong one is we have to add the fields we
want to have under this field group.
So click on add fieild.
So the first one is I would like to add a
text field so for phone number.
So what I am doing is I adding you know phone
number. This field name will be automatically
shown up. Field type we have to select here.
Here we have different options like text field,
text area, Number, Email, Password etc.
So for this article purpose what I am doing
is I am doing is I am adding these two fields.
A text field for phone number and a text area
for address.
So select text here.
You can add any field instructions here. So
if you can enter "Please enter your phone
number here."
So if you want to make it as a required field
you can select it as "Yes" otherwise "No".
When it is required field yes means while
you are making a post if you don't enter you
know the phone number then it won't allow
you to publish this one.
So lets select yes here adn default value
you know you can put a default value like
"1234567890". So this is the defacult value
that will appear.
So there are some other options which you
don't need to use so the frist thing I have
done is I have added a text field.
I would like to add another field which is
a text area for address pusrpose. So click
add field one more time and here like you
know the field label is address and filed
name will automatically pop up under the field
type select text area here. So enter the field
instructions enter "please enter your address
here".
So for required no it is not required. We
are leaving it as default value here.
Default value, you know you can enter any
default value here.
Number of rows I am limiting it to 4.
That means only four rows will appear and
you know, now so we have added a text field
and a text area field.
Next one is the location where exactly you
would like to have this fiedl group that means
the new fields that we have added which are
text field for phone number and text area
for address where exactly you want to display
them.
Do you want to display them on a post or a
page or any where else you have these options.
If you want to display it on a post type,
then you have to select thies like you knwo
you have different options here post type
etc. You have to select post type equal to
post.
If you select it page here the options will
appear on a page. We would like to do it on
a post so select it as post.
Similarly here you have another option is
equal to is not eual to, if you select is
not equal to post that means on a post the
new field groups won't be displayed but they
will be displayed on a page.
So let's select "is equal to".
Here also you have different options, let's
say Post is equal to, then post is equal,
here you will get, like you know you will
get different and you can select a particular
post and only on that particular post these
new fields will be shown.
The next one is post category so post category
is equal to that means here if the post category,
like you know I don't have any other categories
here, normally if you have any categories
they will appear here and if you select any
category only the posts under that particular
category only on those posts the new posts
will be displayed.
So for this articlie purpose I am selecting
Post Type is equal to Post here
So that means whenever you want to make a
new a new post these new fields will be added.
So there are some other options also here
normally you don't need ot use these options
here but if you want to try you can try these
otpions also.
Once you are done with all these settings
click on publish. you have to publish this
one that means this new field group that you
have created with different fields will be
saved now.
So click on publish.
Ok. So now the field group is saved and the
field labels are phone number and address
and this is the field name here. The field
names are phone_no and address so these two
things we have to remember. Because while
you are making a post these fields will appear
and you will enter a phone number and address
but you know if you want to display the phone
number and address you have entered on the
original fields you have to make some changes
to the template I will show it to you how
to do that one.
For the time being let us just remember that
one phone_no and address. Now if you go to
like you know post and add new that means
if you want to create a new post, I am juyst
opening a new tab to show you the new fields
that we have added. This is the post we are
adding a new post here and if you go here
at the bottom you will see the phone number
and address we have added. If you see phone
number is a compulsory one, it is showing
a star mark here. That means if you don't
enter the phone number and you know the post
wont be published. This is the default value
we ahve entered. Take out this one. Address,
you see, this is the text area field that
we have creatd and this is not a compulsory
one because we haven't specified it as a compuslory
one. So it's not showin any red mark here
and it;s also not showing any default value
here. Now let's try to make a post here.
So what I am doing is I am tryign enter a
post here. "Testing Advanced Custom Fields
Plugin". So 
this is 
a some title I 
have given.
Once you make 
the 
post now you have to 
add some code 
to your template to display 
these newly added information on 
your posts.
