how to create shortcode in wordpress

You can create your short code just few steps.

function short_codeFunction_name( $atts, $content=null ) {
    shortcode_atts( array(), $atts);
    $rowin = '<div class="row">'.do_shortcode( $content ) .'</div>';
    return $rowin;
}
add_shortcode( "your_shortcode_name", "short_codeFunction_name" );
  1. Then you can access [your_shortcode]Here your
    content[your_shortcode]
    format inside the Post,page etc.
  2. add this function inside function.php in active theme directory.

  3. use inside your theme directory

Leave a Comment