Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   How do I show/echo Custom Field in page (http://forum.bytesforall.com/showthread.php?t=16286)

_kimberley Dec 17, 2011 12:56 AM

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) ?>

juggledad Dec 17, 2011 05:21 AM

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.

_kimberley Dec 19, 2011 02:22 AM

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?

juggledad Dec 19, 2011 03:58 AM

the PHP function 'echo()' will echo a field - for example
HTML Code:

<?php echo "hello world"; ?>
will 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 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.