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();
The topic ‘New-post not Save in frontend’ is closed to new replies.
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!
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.