D
D
Dmitry Petrov2015-11-09 19:17:18
PHP
Dmitry Petrov, 2015-11-09 19:17:18

How to display the value of a custom WordPress category field?

Hello. I found the only article with a working method for adding custom fields for headings, I did everything, but now I don’t know how to display the value of this field for the heading.
Here is a link to the article.
Tell me good people.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Chiz77, 2015-11-09
@krutoo

<?php $key_1_value = get_post_meta(76, 'field_name', true); ?>
where: fiel_name is the name of the custom field, 76 is the id of the post from which you want to pull the value
wp-kama.ru/function/get_post_meta
there are a lot of details

W
WordPress WooCommerce, 2015-11-10
@maxxannik

MB is worth waiting for WP 4.4 will be released towards the end of the month. There, these metafields will already be built into the kernel. It will be possible to add and receive the usual functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question