How do I show/echo Custom Field in page
I added a New Custom Field called:
name_casino How do I echo this variable in my page? I had something like this: <? echo $bfa_ata['name_casino']; ?> and this: <? echo get_post_meta($post->ID, 'name_casino', true) ?> |
First you need a plugin like 'exec-php' inorder to have php in the page.
the first example you show is meaningless since the custom field has nothing to do with Atahualpa and '$bfa_ata[...]' is the Bytes For All (the theme) array of variables . your second try should work. |
Oke exec-php is installed, but don't know what you mean after that.
Which code do I must use to echo a custom field? |
the PHP function 'echo()' will echo a field - for example
HTML Code:
<?php echo "hello world"; ?> To echo custom fields you need to know how to access them. You should look thru the wordoress codex (http://codex.wordpress.org/) to find a function that and/or instrctions to find the filed. This has nothing to due with the theme since you are doing it in a post it will apply to all themes. |
All times are GMT -6. The time now is 05:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.