Issue
How to add custom theme content in kingcomposer wordpress page builder plugin?I want to add custom content in kingcomposer.
Solution
You can easily integrate KingComposer plugin in your custom theme. Follow below instruction-
This instruction helps you integrate your website with any theme and KingComposer page builder.
Admin elements
- Install Kingcomposer plugin via page added plugin
- Creat file and include via function.php in your theme
I created file kc_element.php in folder inc/kc_element.php
I call it via file function.php
require 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' )
),
)
)
)
);
Front-end elements:
- Creat shortcode file and include via function.php in your theme
I created file kc_shortcode.php in folder inc/kc_shortcode.php
I call it via file function.php
require 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;
}
Check it know more about King Composer plugin. Available all type in king composer plugin http://docs.kingcomposer.com/getting-started/installation/
Thanks
Answered By - Jilani A
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.