ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل shujaur Rahman , Senior software engineer(web developer) , Ikonami pvt limited
تاريخ النشر: 2017/03/22
medhatmahmoud mahmoud
من قبل 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
من قبل alaa liswe , ِAdministrative Assistant , Arab Open University

https://codex.wordpress.org/Creating_Tables_with_Plugins

you can see this website

Kamal Hasija
من قبل 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 />";}?>

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟