Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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, 01:56 AM
_kimberley's Avatar
_kimberley
 
51 posts · Dec 2011
Amsterdam
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, 06:21 AM
juggledad's Avatar
juggledad
 
23,765 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 06:24 AM.
  #3  
Old Dec 19, 2011, 03:22 AM
_kimberley's Avatar
_kimberley
 
51 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 04:55 AM.
  #4  
Old Dec 19, 2011, 04:58 AM
juggledad's Avatar
juggledad
 
23,765 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



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 02:11 PM
Change Custom Field display in page editor kdawes01 Atahualpa 3 Wordpress theme 2 Sep 4, 2011 10:47 PM
[SOLVED] Use Custom Field image_src to Show Thumbnail in Excerpt Big Geek Daddy Header configuration & styling 8 Mar 6, 2011 06:33 PM
Button with Custom Field Xethon Sidebars & Widgets 0 Sep 17, 2010 05:08 AM
Custom field image with custom field link mbastos Atahualpa 3 Wordpress theme 1 Jul 1, 2010 09:17 AM


All times are GMT -6. The time now is 08:19 PM.


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