Wpbakery Custom Element Short Code is plugin-territory functionality in Envato Theme Check.

Hello guys,
I am facing a problem while check quality of my newly created wordpress theme with Envato Theme Check plugin. I am getting this warning " The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.". The only shortcode i am using is in the custom element of wpbakery could you please help me out that how can i fix this. Here is the code

function get_vc_post( $atts, $content = null ) {
    extract( shortcode_atts( array(
        'number'       => '',
        'columns'      => '',
        'class'        => '',
    ), $atts ) );
    $args = array( 'posts_per_page' => $number);
    $loop = new WP_Query( $args );
    <div class="row vc-recent-posts">
        <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
            <div class="<?php echo $columns; ?>">
                <div class="post-thumbnails">
                    <a href="<?php echo get_post_permalink() ?>" title="<?php the_title(); ?>">
                        <div class="post-figure">
                            <?php the_post_thumbnail(); ?>
                    <div class="post-thumb-content">
                    <a href="<?php echo get_post_permalink() ?>" title="<?php the_title(); ?>">
                        <p class="post-publish-date">
                            <span><?php echo  get_the_date(); ?></span>
                        <div class="post-thumb-summary">
                        <a href="<?php echo get_post_permalink() ?>" title="<?php the_title(); ?>">
                            <h5 class="post-thumb-title"><?php the_title();?></h5>
                            <p class="post-thumb-excerpts"><?php the_excerpt();?></p>
                        <div class="post-thumb-readmore">
                        <a href="<?php echo get_post_permalink() ?>" class="readmore-link" title="<?php the_title(); ?>">
                            <?php echo __('Continue Reading ', 'affiliator') ?>
        <?php endwhile; /** Have Posts */
        wp_reset_query(); ?>
add_shortcode( "blogpost", "get_vc_post" );

All shortcodes and widgets have to be added via plugin. Please take your time and read through all theme requirements.

1 Like