Answer the question
In order to leave comments, you need to log in
Linking the Advanced Custom Fields Pro plugin and WP User Frontend Pro or how to display ACF fields in the frontend?
Hello! Tell me who faced. There is a task to make additional fields for posts in WordPress, and adding this post (with additional fields) through the frontend. Completely arranged the Advanced Custom Fields plugin with its fields, but to find a working plugin that would display its extra. fields on the frontend, fails. I installed WP User Frontend Pro, which can easily create forms for the frontend, and also has similar additional fields as in ACF (I was not satisfied). I read somewhere that WP User Frontend Pro has the ability to display fields of other plugins, including ACF, but I can’t find how to implement this anywhere.
I will make a reservation right away about the documentation for ACF - I saw the section on how to make a frontend, but I want to take the path of least resistance.
If there is no answer to the question of ACF and WPUF, then please tell me other solutions. Thank you!
Answer the question
In order to leave comments, you need to log in
Start over. Pure WordPress, then Advanced Custom Fields (take version 5), then create the desired group of fields, then display it as a form on the frontend using native ACF functions.
I did it, everything works. Therefore, most likely the problem is on your side. Let's go step by step and see where it doesn't work.
UPDATE (from comments) : As for the form itself:
1. Create a custom template, it will need to be used for the page on which the form should be (the template in the admin panel in page editing is selected on the right).
2. In the template itself, on top of the file header is:
<?php
/*
Template Name: ACF Form
*/
acf_form_head();
get_header();
?>
$args = array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'YOUR_POST_TYPE',
'post_status' => 'draft',
),
'post_title' => true,
'submit_value' => 'Создать',
'updated_message' => 'Ваша запись поставлена в очередь на модерацию',
'label_placement' => 'left',
);
acf_form( $args );
Igor, thank you for your reply.
Can I have a couple of questions:
1) I can not rename the title and content fields to my own, is it real?
2) Can individual fields be disabled for filling? They do not need to be displayed, only the admin displays.
3) Tested the addition. The form is submitted. But for some reason, additional news does not appear in amdink.
Is there any trick?
4) don't know by chance how to place such a form in a modal to display it on different pages where there is an output of this modal window?
5) How to add the ability to upload a thumbnail?
Might be useful to someone
1) I can’t rename the title and content fields to my own, is it possible?
add_filter( 'acf/get_valid_field', 'change_input_labels');
function change_input_labels($field) {
if($field['name'] == '_post_title') {
$field['label'] = 'Название';
}
if($field['name'] == '_post_content') {
$field['label'] = 'Содержание';
}
return $field;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question