2017-01-04 39 views

答えて

0

KingComposerプラグインをカスタムテーマに簡単に統合することができます。以下の指示に従ってください:

この指示は、あなたのウェブサイトをテーマやKingComposerページビルダーと統合するのに役立ちます。

管理要素

  1. は、私は、フォルダINCにファイルkc_element.phpを作成したページの追加プラグイン
  2. クリートファイルを経由してKingcomposerプラグインをインストールし、あなたのテーマにfunction.php経由

が含まれます/kc_element.php

私はファイルfunction.php経由で呼び出します

にはget_template_directory()が必要です。 '/inc/kc_element.php';

global $kc; 
    $kc->add_map(
     array(
      'element_id' => array(
       'name'  => __('Text Title', 'domain'), 
       'description' => __('Display text and description', 'domain'), 
       'category' => __('Twenty_Sixteen', 'domain'), 
       'icon'  => 'fa-header', 
       'params'  => array(
        array(
         'name'  => 'title', 
         'label'  => __('Title', 'domain'), 
         'type'  => 'text', 
         'description' => __('Insert text title', 'domain'), 
         'value'  => 'Insert Title', 
         'admin_label' => true 
        ), 
        array(
         'name'  => 'desc', 
         'label'  => __('Description', 'domain'), 
         'type'  => 'editor', 
         'description' => __('Text description', 'domain'), 
         'value'  => base64_encode('Insert Content') 
        ), 
       ) 
      ) 
     ) 
    ); 

フロントエンド要素:

  1. クリートのショートファイルをし、あなたのテーマにfunction.php経由含ま

私は、フォルダINC/kc_shortcodeでファイルkc_shortcode.phpを作成しました。 ph

私はファイルfunction.php経由で呼び出します

get_template_directory()が必要です。 '/inc/kc_shortcode.php';

add_shortcode('element_id', 'element_Function'); 

function element_Function($atts){ 

    $title = $desc = ''; 
    extract($atts); 

    echo $title; 
    echo $desc; 

} 

King Composerプラグインの詳細を確認してください。利用可能な 王コンポーザープラグインのすべての種類http://docs.kingcomposer.com/getting-started/installation/

おかげ
BanyanTheme

0

あなたは簡単にフォローコードによってあなたのポストタイプを追加することができます。

global $kc; 
// add single content type 
$kc->add_content_type('your-post-type-name'); 
// add multiple content types 
$kc->add_content_type(array('type-1', 'type-2')); 

・ホープ理にかなっています。

+0

ドキュメントサイトから詳細を取得することができますhttp://docs.kingcomposer.com/ –

+0

どうもありがとう... –

関連する問題