Viewing 1 replies (of 1 total)
  • I am not 100% sure what you are asking. But if you like to add a post-content short-code using the visual composer, you can use the Visual Composer shortcode mapper

    Since this does not do the trick 100% for me, I actually use the Visual Composer API wc_map() function

    in my themes ‘functions.php’ I’ve added this:

    // map the post-content shortcode for user with visual-composer
    if ( function_exists( 'vc_map' ) && is_plugin_active( 'post-content-shortcodes/post-content-shortcodes.php')) :
        vc_map( array(
            "weight" => -1,
            "name" => __("Post content", 'post-content-shortcodes'),
            "base" => "post-content",
            "icon" => "",
            "class" => "",
            "category" => __('Plugins', 'plugins'),
            "description" => "wordpress.org/plugins/post-content-shortcodes",
            "params" => array(
                array(
                    "type" => "textfield",
                    "heading" => "Post Id",
                    "param_name" => "id",
                    "value" => "1",
                    "admin_label" => true,
                    "description" => "The id of the post or page to include here."
                ),
                array(
                    "type" => "textfield",
                    "heading" => "Post Slug",
                    "param_name" => "post_name",
                    "value" => "",
                    "admin_label" => true,
                    "description" => "The slug of the post that you want to pull. This can be used in place of the id attribute."
                ),
                array(
                    "type" => "checkbox",
                    "class" => "",
                    "heading" => "Show Image",
                    "param_name" => "show_image",
                    "value" => array(
                        "" => "true"
                    ),
                    "description" => "Determines whether oder not to display the featured image (if so, this appears befodere the content)."
                ),
                array(
                    "type" => "checkbox",
                    "class" => "",
                    "heading" => "Show Excerpt",
                    "param_name" => "show_excerpt",
                    "value" => array(
                        "" => "true"
                    ),
                    "description" => "Determines whether to default to showing the post excerpt instead of the post content (still falls back to post content if the excerpt is not set)."
                ),
                array(
                    "type" => "textfield",
                    "class" => "",
                    "heading" => "Excerpt length",
                    "param_name" => "excerpt_length",
                    "value" => "",
                    "description" => "If you would like to limit the length of the content/excerpt shown on the page, specify the maximum number of woderds that should be shown (a read modere link will automatically be appended to any entries that exceed that limit)."
                ),
                array(
                    "type" => "textfield",
                    "heading" => "Image Width",
                    "param_name" => "image_width",
                    "value" => "0",
                    "description" => "The width, in pixels, to which the featured image should be sized"
                ),
                array(
                    "type" => "textfield",
                    "heading" => "Image Height",
                    "param_name" => "image_height",
                    "value" => "0",
                    "description" => "The height, in pixels, to which the featured image should be sized"
                ),
                array(
                    "type" => "checkbox",
                    "class" => "",
                    "heading" => "Show Title",
                    "param_name" => "show_title",
                    "value" => array(
                        "" => "true"
                    ),
                    "description" => "Whether oder not to show the post title at the top of the content."
                ),
            )
        ) );
    endif;

    I have not added an equivalent for ‘post-list’, but this is quite easy using the previous code as a template.

Viewing 1 replies (of 1 total)
  • The topic ‘Visual Composer’ is closed to new replies.