Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can we handle the custom field in wordpress mean which db tables involves and which hooks we use to store custom fields?

user-image
Question added by shujaur Rahman , Senior software engineer(web developer) , Ikonami pvt limited
Date Posted: 2017/03/22
medhatmahmoud mahmoud
by medhatmahmoud mahmoud , Web Designer , Connect Computer Service Co

Displaying custom field:

for example to display custom fileds to each post use the the_meta() template tag.

the tag must be put within the loop in order to work

 

<?php the_meta(); ?>

alaa liswe
by alaa liswe , ِAdministrative Assistant , Arab Open University

https://codex.wordpress.org/Creating_Tables_with_Plugins

you can see this website

Kamal Hasija
by Kamal Hasija , Web Developer , The Brihaspati Infotech Pvt. Ltd.

The custom fields are stored in this table of WordPress wp_postmeta.  $wpdb->postmeta

For displaying you can use this, custom fields to each post use the the_meta() template tag.

the tag must be put within the loop in order to work

 

<?php the_meta(); ?>

e.g.

<?php $mykey_values = get_post_custom_values('my_key');foreach( $mykey_values as $key => $value ){ echo "$key => $value ('my_key')<br />";}?>

More Questions Like This