Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

How do I show/echo Custom Field in page


  #1  
Old Dec 17, 2011, 12:56 AM
_kimberley's Avatar
_kimberley
 
47 posts · Dec 2011
Amsterdam
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) ?>
  #2  
Old Dec 17, 2011, 05:21 AM
juggledad's Avatar
juggledad
 
23,499 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Dec 17, 2011 at 05:24 AM.
  #3  
Old Dec 19, 2011, 02:22 AM
_kimberley's Avatar
_kimberley
 
47 posts · Dec 2011
Amsterdam
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?

Last edited by juggledad; Dec 19, 2011 at 03:55 AM.
  #4  
Old Dec 19, 2011, 03:58 AM
juggledad's Avatar
juggledad
 
23,499 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Tags
custom field, echo, show

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show custom field in kicker - only IF field value exists jaxon Center area post/pages 13 Feb 6, 2013 01:11 PM
Change Custom Field display in page editor kdawes01 Atahualpa 3 Wordpress theme 2 Sep 4, 2011 09:47 PM
[SOLVED] Use Custom Field image_src to Show Thumbnail in Excerpt Big Geek Daddy Header configuration & styling 8 Mar 6, 2011 05:33 PM
Button with Custom Field Xethon Sidebars & Widgets 0 Sep 17, 2010 04:08 AM
Custom field image with custom field link mbastos Atahualpa 3 Wordpress theme 1 Jul 1, 2010 08:17 AM


All times are GMT -6. The time now is 06:09 AM.


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