Quantcast

Introducing custom fields in wordpress basically means to add other data in WordPress and display them at the desired location beside the text. In fact this custom field can be associated with a script and so allow to develop an automated display. The definition of the field is similar to that of a category, it can be done locally in an article but becomes global for the blog. From the moment of the creation of a field, when an article is created or modified, a form at the bottom of the page shows a list of keywords created for custom fields. The custom field form can be considered an interface for passing values to a script.

It is not expected that the field appears automatically, since it depends on the chosen template, and also because the site administrator may want to select the location where to display this field. To do this we must edit the main template, through the menu Theme/Theme editor and select the file for the body of the article, and insert in the_meta() function.

For the classic template, the source code might look like this:

The the_meta() function retrieves the key and value from the database, and provides this information to the display engine that integrates them into the page in HTML. Watch the source code of the page to see how this integration is made. it has the following form:

Finally, Using PHP and some internal functions dedicated to custom fields, it is possible to achieve a personal implementation. Consider the following example of a simple script associated with a custom field:

In the future articles, we would discuss some more custom programming tips for WordPress utilizng CSS, Php and HTML.

Looking for a quality hosting service? here are a few I suggest.
BlueHost | HostGator | Media Temple
Admin
Admin
Ali has been an entrepreneur in web, video and related technologies. Having worked with many business across the globe, Ali stands truly a great pillar in the business working with him.