• Home
  • Quick Start
    • Color Schemes
  • Documentation
    • Shortcodes
    • JaW Hooks
    • Screenshots of ThemeOptions
  • Tutorials
  • Forum
  • Contact
Log In

  • Home
  • Quick Start
    • Color Schemes
  • Documentation
    • Shortcodes
    • JaW Hooks
    • Screenshots of ThemeOptions
  • Tutorials
  • Forum
  • Contact

HomeCodeHow to create own shortcode
show

How to create own shortcode

  • admin
  • Posted in Codefor DevelopersTutorials
0
SHARES
SHARESHARESHARESHARE
SHARESHARE

First part of this tutorial

Also, we recommend to you, to do all these changes in Child Theme.

So we’ve got this shortcode from RevoComposer [jaw_my_element title="" ...  ].

Add this code to your child theme’s function.php

function jaw_my_element_func($atts, $content=""){
    $atts = shortcode_atts( array(
		'title' => '',
		'my_switch' => '1'
	), $atts );
    echo '<div class="my-shortcode">';
    echo 'My awesome shortcode can print this: ';
    if($atts['my_switch'] == '1'){
      echo $atts['title'];
    }
}
//register shortcode 
add_shortcode( 'jaw_my_element' , 'jaw_my_element_func' );

And we got this:
print

Related Posts

wphooks
0 comments
JaW Hooks

Actions jaw_before_usermanagement and jaw_after_usermanagement

menu-widget6
0 comments
CodeTutorials

How to add more Widget areas to menu.

wphooks
0 comments
JaW Hooks

Filter jaw_get_template_part

show2

How to add element to RevoComposer

new option

How to use your own options

Related Posts

wphooks
0 comments
JaW Hooks

Actions jaw_before_usermanagement and jaw_after_usermanagement

menu-widget6
0 comments
CodeTutorials

How to add more Widget areas to menu.

wphooks
0 comments
JaW Hooks

Filter jaw_get_template_part

install-t6
0 comments
Tutorials

How to set Custom Stock Ticker

Tags

  • revocomposer
  • shortcode
  • Was this Helpful ?
  • yes   no
Copyright © 2016 jawtemplates - WordPress Design Studio Disable responsivity