I discovered a tutorial to create a frontend kind to permit customers to have the ability to use a kind to enter their cooking recipes this kind works + – good
https://www.copier-coller.com/creer-un-formulaire-en-front-end-avec-acf/?unapproved=39725&moderation-hash=dacc6e313402b266d5d307223b048150#comment-39725
the precept is as follows we create a kind
<?php /*Template Identify: Person Submit*/; ?>
<?php acf_form_head(); ?>
<?php get_header(); ?>
<div id="container" >
<div class="row">
<div class="col-sm-12">
<?php /* The loop */ ?>
<?php whereas (have_posts()):
the_post(); ?>
<!-- a supprimer si on enlève l'éditeur par défaut -->
<!------------>
<p> <?php the_field('Elements'); ?></p>
<p> <?php the_field('Cuisson'); ?></p>
<p> <?php the_field('Temps'); ?></p>
<p> <?php the_field('Preparation'); ?></p>
<p> <?php the_field('Difficulté'); ?></p>
<?php $choices = array(
'post_id' => 'new',
'field_groups' => array(
4
) ,
'post_title' => true,
'post_type' => 'submit',
'post_status' => 'draft',
//'updated_message' => 'Merci pour votre participation!Votre recette sera publiée prochainement',
'updated_message' => __("Recette publiée", 'acf') ,
'submit_value' => 'Postez votre recette'
);
acf_form($choices); ?>
<?php
endwhile; ?>
</div>
</div><!-- #content material -->
</div><!-- #major -->
<?php get_footer(); ?>
and we modify the single.php
web page which can obtain the info
However one of many issues encountered is that after I need to write a brand new article I find yourself with the configuration of the modified single.php
file
I due to this fact created a brand new sort of publication which is known as recipe and which can be supposed to gather the info from the shape
I additionally created a brand new single-recipe.php file to show the info acquired from the shape And I modified within the kind this line ‘post_type’ => ‘submit’, in
‘post_type’ => ‘recipe’, However nothing modifications after I submit the shape a brand new article is at all times added within the articles and never within the recipe