Answer the question
In order to leave comments, you need to log in
How to display all posts using carbon fields using carbon fields?
Hello.
How can I display all posts where the carbon fields plugin is used?
I created custom fields:
Container::make('post_meta', 'Настройки продукта')
-> show_on_template('product-template.php')
-> add_fields(array(
Field::make('text', 'price_field', 'Цена') -> set_width(50),
Field::make('textarea', 'price_short_description', 'Краткое описание'),
));
$products = carbon_get_post_meta( $id, $name );
var_dump($products);
Answer the question
In order to leave comments, you need to log in
If anyone is interested:
$query = new WP_Query(array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'price_field',
),
),
));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question