For anything that involves customizing functions.php, you can put the custom code anywhere in the file, usually near the end of the file. Your functions.php file may instruct you, via comments inside it, where to put any custom code.

For anything that involves customizing functions.php, you can put the custom code anywhere in the file, usually near the end of the file. Your functions.php file may instruct you, via comments inside it, where to put any custom code.

+

+

= Displaying value of custom field =

+

+

It is possible to create custom fields when editing a Post or a Page and set values for them.

+

+

Ex.:

+

+

[[File:Screen Shot 2012-06-23 at 2.12.19 PM.png|556px|thumb|none]]

+

+

The value of this custom field can be pulled and shown in any WordPress template file using the following sample code:

+

+

<pre class="brush:php;">

+

<?php

+

global $post;

+

$price = get_post_meta($post->ID, 'price', true);

+

if ( !empty($price) ) { echo 'Price: ' . $price; }

+

?>

+

</pre>

+

+

The above code checks for a custom field named "price", fetches its values and stores it in a variable called $price, checks to see if it is empty and if it's not empty will be shown on the page preceded by a text string.

How to update a plugin

Not all plugins can be updated from the dashboard. In such cases the recommended method to update a WordPress plugin is to use Easy Theme and Plugin Upgrades plugin. If this plugin does not work, use a FTP client or cPanel file manager to replace the plugin's folder with the latest version.

Editing or Adding Stuff to Functions.php

Sometimes you have to add extra custom code to the functions.php file in your theme's folder.

For anything that involves customizing functions.php, you can put the custom code anywhere in the file, usually near the end of the file. Your functions.php file may instruct you, via comments inside it, where to put any custom code.

Displaying value of custom field

It is possible to create custom fields when editing a Post or a Page and set values for them.

Ex.:

The value of this custom field can be pulled and shown in any WordPress template file using the following sample code:

The above code checks for a custom field named "price", fetches its values and stores it in a variable called $price, checks to see if it is empty and if it's not empty will be shown on the page preceded by a text string.