This file contains hidden or 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
// Shortcode for 'Page title': [yl_page_title] | |
function yl_page_title_shortcode() { | |
return get_the_title(); | |
} | |
add_shortcode('yl_page_title','yl_page_title_shortcode'); |
This file contains hidden or 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
// ACF fields | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array( | |
'key' => 'group_5fb7906422ec4', | |
'title' => 'Yorlinq WhatsApp plugin', | |
'fields' => array( | |
array( | |
'key' => 'field_61fcc8b8c23be', | |
'label' => 'Algemeen', |
This file contains hidden or 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
// Add ACF fields | |
if( function_exists('acf_add_local_field_group') ): | |
acf_add_local_field_group(array( | |
'key' => 'group_61fb8a113f4f5', | |
'title' => 'Yorlinq Dynamic Order Info plugin', | |
'fields' => array( | |
array( | |
'key' => 'field_61fb9e02ae2fb', | |
'label' => 'Algemeen', |
This file contains hidden or 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
// Shortcode for 'Copyright notice' with current year: [yl_copyright_notice] | |
function yl_copyright_notice_shortcode() { | |
return '© ' . date('Y') . ' ' . get_bloginfo('name') . '. ' . __( 'All rights reserved.', 'yorlinq' ) . '<br class="uk-hidden@s"> ' . __( 'Developed by', 'yorlinq' ) . ' <a href="https://yorlinq.nl" target="_blank" class="uk-text-primary">Yorlinq</a>.'; | |
} | |
add_shortcode('yl_copyright_notice','yl_copyright_notice_shortcode'); |
This file contains hidden or 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
// Add custom stylesheet to WordPress header | |
wp_enqueue_style( 'yorlinq-layout', get_home_url() . '/wp-content/uploads/network/css/yl-styling.css' ); |
This file contains hidden or 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
// Shortcode for 'Product name' by 'Product id': [yl_product_name id=''] | |
function yl_product_name_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts ); | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); | |
$output = $_product->get_title(); | |
} |
This file contains hidden or 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
// Shortcode for 'Product description' by 'Product id': [yl_product_short_desciption id=''] | |
function yl_product_short_desciption_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts ); | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); | |
$output = $_product->post->post_excerpt; | |
} |
This file contains hidden or 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
// Shortcode for 'Current product name': [yl_current_product_name] | |
function yl_current_product_name_shortcode() { | |
global $product; | |
$output = get_the_title(); | |
return $output; | |
} | |
add_shortcode( 'yl_current_product_name', 'yl_current_product_name_shortcode' ); |
This file contains hidden or 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
// Shortcode for 'Product price' by 'Product id': [yl_product_price id=''] | |
function yl_product_price_shortcode($atts) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts ); | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); | |
$output = $_product->get_price_html(); | |
} |
This file contains hidden or 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
// Shortcode for 'Product url' by 'Product id': [yl_product_url id=''] | |
function yl_product_url_shortcode($atts) { | |
$atts = shortcode_atts( array( | |
'id' => null, | |
), $atts ); | |
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){ | |
$_product = wc_get_product( $atts['id'] ); | |
$output = $_product->get_permalink(); | |
} |