This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WordPress site name via shortcode: [iw_site_name] | |
function iw_site_name_shortcode() { | |
return get_bloginfo('name'); | |
} | |
add_shortcode('iw_site_name','iw_site_name_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WordPress site url via shortcode: [iw_site_url] | |
function iw_site_url_shortcode() { | |
return get_bloginfo('url'); | |
} | |
add_shortcode('iw_site_url','iw_site_url_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WordPress site email via shortcode: [iw_site_email] | |
function iw_site_email_shortcode() { | |
return get_bloginfo('admin_email'); | |
} | |
add_shortcode('iw_site_email','iw_site_email_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get current page title via shortcode: [iw_page_title] | |
function iw_page_title_shortcode() { | |
return get_the_title(); | |
} | |
add_shortcode('iw_page_title','iw_page_title_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get current year via shortcode: [iw_current_year] | |
function iw_current_year_shortcode() { | |
return date("Y"); | |
} | |
add_shortcode('iw_current_year','iw_current_year_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WooCommerce product name by ID via shortcode: [iw_product_name id=''] | |
function iw_product_name_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts, 'bartag' ); | |
$html = ''; | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WooCommerce product price by ID via shortcode: [iw_product_price id=''] | |
function iw_product_price_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts, 'bartag' ); | |
$html = ''; | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WooCommerce product url by ID via shortcode: [iw_product_url id=''] | |
function iw_product_url_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts, 'bartag' ); | |
$html = ''; | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get WooCommerce product image by ID via shortcode: [iw_product_image id=''] | |
function iw_product_image_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts, 'bartag' ); | |
$html = ''; | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); |
OlderNewer