1

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:

  1. I created 2 custom field groups, with the id's: 88 & 139.
  2. In Wrapper.php i added the code: <?php acf_form_head(); ?>
  3. In form-listing.php i created 2 custom hooks, 'product_custom' and 'product_custom2': <?php do_action( 'product_custom' ); ?> <?php do_action( 'product_custom2' ); ?>
  4. 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:

  1. Both field groups have a WYSIWYG field. However for some reason the WYSIWYG buttons and media button stop working
  2. I cannot fill in any text in the first WYSIWYG field. Only the second one works for that matter.
  3. 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

4

2 に答える 2

1

見晴らしの良いテーマで ACF を実装することに成功しました。

Vantage リスト フォームに ACF フォームを追加し、Vantage フォームと ACF フォームを組み合わせます。ワンボタンで。

データはデータベースに保存され、呼び出してリスト領域に表示できます。画像の追加ボタンのみがフロントエンドからは機能しませんが、バックエンドではボタンが機能しています。

  1. <?php acf_form_head(); ?>wrapper.php への追加

  2. このチュートリアルフロント エンド フォーム ヘルプを実行します

  3. form-listing.php のデフォルトの Vantage 送信ボタンを削除

  4. 関数内の ACF api.php にこのコードを追加します。acf_form_head()

     // allow for custom save
    
    $post_id = apply_filters('acf_form_pre_save_post','va_after_create_listing_form', $post_id);
    

それだけです。あなたのサイトでうまくいくことを願っています。

于 2013-07-05T08:22:42.637 に答える
0

誰かがウェブサイトにアクセスしたときに、訪問したページを介して情報を送信できるようにしたいですか。

そうでない場合は、単純にバックエンド (dreamweaver など) からの ACF データを single-listing.php に追加し、フィールドの操作に関する ACF チュートリアルを使用することができます。

これが多少役立つことを願っています

乾杯

于 2013-06-30T03:40:16.010 に答える