Home › Forums › Front-end Issues › New-post not Save in frontend
I have a problem saving new entries from the frontend, at the time of saving the entry, it only loads the page of the form and returns the blank form and the post is not generated.
Can you help me, please?
<?php
acf_form_head();
/*
Template Name: Nuevo Historial
*/
get_header();
//Actual User
if (is_user_logged_in()) {
$uid = get_current_user_id();
}
$is_page_builder_used = et_pb_is_pagebuilder_used(get_the_ID()); ?>
<div id=”main-content”>
<?php if (!$is_page_builder_used) : ?>
<div class=”container”>
<div id=”content-area” class=”clearfix”>
<div id=”left-area”>
<?php endif; ?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<div class=”entry-content” style=”padding-bottom: 50px;”>
<h2>Agregar Historial Cl铆nico</h2>
<?php
$fields = array(
‘field_5d128dd7a06ea’, // Fecha
‘field_5d128dfba06eb’, // Motivo
‘field_5d128e543a3ce’, // Embarazo
‘field_5d128e973a3cf’, // Meses Embarazo
‘field_5d1293ce1cae6’, //Heredofamiliares
‘field_5d1294f208b36’, //A. Patol贸gicos
‘field_5d1295e9ec1f9’, // Padecimientos A.
‘field_5d1296bdaf0aa’, // Medicamentos
‘field_5d1297e3a6224’, // Exploraci贸n
‘field_5d152879d2965’, //Realiza Ej.
‘field_5d152a0abadd7’, // Tipo Ej.
‘field_5d152a37badd8’, // Frecuencia
‘field_5d152aafbadd9’, // Duraci贸n
‘field_5d152b2ebadda’, // Frecuencia ducha
‘field_5d152b62baddb’, // Evacuaciones
‘field_5d152b8ebaddc’, // Micciones
‘field_5d152bacbaddd’, //F.Lavado Dientes
‘field_5d153485e161d’, //Consumo
‘field_5d15357a8e22c’, //Comidas Diarias
‘field_5d1536fb309c5’ //Alimentacion
);
acf_register_form(array(
‘id’ => ‘new-historial’,
‘post_id’ => ‘new_post’,
‘new_post’ => array(
‘post_type’ => ‘historial’,
‘post_status’ => ‘publish’
),
‘post_title’ => true,
‘post_content’ => false,
‘uploader’ => ‘basic’,
‘return’ => home_url(‘expediente-paciente’),
‘fields’ => $fields,
‘submit_value’ => ‘Agregar Historial’
));
// Load the form
acf_form(‘new-historial’);
?>
<?php
if (!$is_page_builder_used)
wp_link_pages(array(‘before’ => ‘<div class=”page-links”>’ . esc_html__(‘Pages:’, ‘Divi’), ‘after’ => ‘</div>’));
?>
</div> <!– .entry-content –>
</article> <!– .et_pb_post –>
<?php if (!$is_page_builder_used) : ?>
</div> <!– #left-area –>
<?php get_sidebar(); ?>
</div> <!– #content-area –>
</div> <!– .container –>
<?php endif; ?>
</div> <!– #main-content –>
<?php
get_footer();
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.