I have repeatedly been trying to implement the Advanced Custom Fields (ACF) plugin in the Vantage theme (from AppThemes), but without any success. I've had extensive contact with the admin of ACF, on this subject, but unfortunately we did not succeed. He advised to ask here, maybe seek for a (paid) developer, to solve this problem.
Ok, so what am i trying? I have created a custom field group and want to implement that field group within the listing form of Vantage. To do so i have read several docs, including: http://www.advancedcustomfields.com/resources/tutorials/creating-a-front-end-form/. To be complete, based on this i did the following in the Vantage theme folder:
- I created 2 custom field groups, with the id's: 88 & 139.
- In Wrapper.php i added the code:
<?php acf_form_head(); ?>
- In form-listing.php i created 2 custom hooks, 'product_custom' and 'product_custom2':
<?php do_action( 'product_custom' ); ?> <?php do_action( 'product_custom2' ); ?>
In fuctions.php i created 3 functions:
add_action( 'wp_print_styles' , 'my_deregister_styles' , 100 ); function my_deregister_styles() { wp_deregister_style( 'wp-admin' ); } add_action( 'product_custom' , 'productfields' ); function productfields() { $options = array( 'field_groups' => array('post' => '88' ), 'form' => false, ); acf_form( $options ); } add_action( 'product_custom2' , 'productfields2' ); function productfields2() { $options2 = array( 'field_groups' => array('post' => '139' ), 'form' => false, ); acf_form( $options2 ); }
This actually made the custom field group show up in the listing form of Vantage. However the following things keep going wrong:
- Both field groups have a WYSIWYG field. However for some reason the WYSIWYG buttons and media button stop working
- I cannot fill in any text in the first WYSIWYG field. Only the second one works for that matter.
No data is stored at all after saving the listing form. On advise of the ACF admin, i tried the following in the acf-master/core/api.php file:
// run database save first if( isset($_POST['acf_save']) ) { $txt="Hello world!"; echo $txt; die();
However the string does not display after saving the listing form. So the if statement is not used... 4. To display the dataon the frontend, once they are saved, I guess the default wordpress codex can be used..
I tried to be as complete as possible;) Is there anybody who can help me any further? Paid assistance is also negotiable..
Thanks a lot in advance! Robbert