Home › Forums › Front-end Issues › Not working scripts ACF logic › Reply To: Not working scripts ACF logic
<?php
/*
Template Name: ACF Form
*/
acf_form_head();
get_header();
acf_enqueue_uploader();
?>
<div class="acf-grid">
<div class="grid">
<div class="col-3" id='category'></div>
<div class="col-9 grid">
<div class="col-12 grid">
<div class="col-6" id='cat-box'></div>
<div class="col-6"></div>
</div>
<div class="col-12 grid">
<div class="col-6" id='adres'></div>
<div class="col-6" id='contacty'></div>
</div>
</div>
</div>
<div class="grid">
<div class="col-9" id='descriptions'></div>
<div class="col-3" id='add-file'></div>
</div>
</div>
<?php
$args = array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'markers',
'post_status' => 'draft',
),
'post_title' => false,
'submit_value' => 'Создать',
'updated_message' => 'Ваша запись поставлена в очередь на модерацию'
);
acf_form( $args );
?>
<script type="text/javascript">
//$(document).ready(function() {
acf.add_action('ready', function( $el ){
$('.acf-grid').appendTo('.acf-form-fields');
$('.category').appendTo('#category');
$('.cat-box').appendTo('#cat-box');
$('.adres').appendTo('#adres');
$('.contacty').appendTo('#contacty');
$('.descriptions').appendTo('#descriptions');
$('.add-file').appendTo('#add-file');
});
//});
</script>
<?php get_footer(); ?>
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!
🗓️ Just one more day until the next session of ACF Chat Fridays! Make sure to register for the latest updates on what’s coming in ACF 6.1!
— Advanced Custom Fields (@wp_acf) March 30, 2023
📆 Friday 31st March 3pm UTC
👉 Register here - https://t.co/3UtvQbDwNm pic.twitter.com/7xtEJakeQN
© 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.