'header_logo',
), $atts);
ob_start();
dotspice_logo($atts['option']);
return ob_get_clean();
}
add_shortcode('logo', 'dotspice_logo_shortcode');
/**
* [jumbotron-title] Shortcode
*/
function dotspice_jumbotron_title_shortcode()
{
$options_ID = false;
if (class_exists('woocommerce') && is_shop()) {
$options_ID = wc_get_page_id('shop');
}
$title = get_field('jumbotron_title', $options_ID);
$title_text = !empty($title['text']) ? $title['text'] : dotspice_get_page_title();
$title_tag = !empty($title['tag']) ? $title['tag'] : 'h2';
return sprintf('<%s class="jumbotron__h" %s>%s%s>', esc_attr($title_tag), dotspice_schema('title', false), $title_text, esc_attr($title_tag));
}
add_shortcode('jumbotron-title', 'dotspice_jumbotron_title_shortcode');
/**
* [jumbotron-desc] Shortcode
*/
function dotspice_jumbotron_desc_shortcode()
{
$options_ID = false;
if (class_exists('woocommerce') && is_shop()) {
$options_ID = wc_get_page_id('shop');
}
if (get_field('jumbotron_desc', $options_ID)) {
return sprintf('
%s
', get_field('jumbotron_desc', $options_ID));
}
}
add_shortcode('jumbotron-desc', 'dotspice_jumbotron_desc_shortcode');
/**
* [footer-copy] Shortcode
*/
function footer_copy_shortcode($atts)
{
$atts = shortcode_atts(array(
'title' => parse_url(get_bloginfo('url'), PHP_URL_HOST),
), $atts);
return sprintf(
'© %s %s | %s Dotspice.com',
date('Y'),
$atts['title'],
esc_html__('Designed by:', 'dotspice')
);
}
add_shortcode('footer-copy', 'footer_copy_shortcode');
/**
* [counter] Shortcode
*/
function counter_shortcode($atts)
{
$atts = shortcode_atts(array(
'numb' => '',
'delay' => '10',
'time' => '2000'
), $atts);
if (!empty($atts['numb'])) {
// Enqueue scripts
wp_enqueue_script('waypoints', 'https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js', array('jquery'), '', true);
wp_enqueue_script('countup', get_template_directory_uri() . '/js/jquery.countup.min.js', array('jquery'), '', true);
return sprintf(
'%s',
$atts['delay'],
$atts['time'],
$atts['numb']
);
}
}
add_shortcode('counter', 'counter_shortcode');
/**
* [svg] Shortcode
*/
function svg_shortcode($atts)
{
$atts = shortcode_atts(array(
'icon' => '',
'size' => false,
'fill' => '',
'style' => false,
), $atts);
if (!empty($atts['icon'])) {
return dotspice_get_svg_icon($atts['icon'], 'html', $atts);
}
}
add_shortcode('svg', 'svg_shortcode');
/**
* [blog-posts] Shortcode
*/
function blog_posts_shortcode($atts)
{
$atts = shortcode_atts(array(
'post_type' => 'post',
'orderby' => 'date',
'order' => 'DESC',
'post_status' => 'publish',
'posts_per_page' => 3,
'cat' => '',
'offset' => 0,
'post__in' => false,
'post__not_in' => false,
'ignore_sticky_posts' => true,
), $atts);
$atts['post__in'] = !empty($atts['post__in']) ? wp_parse_id_list($atts['post__in']) : false;
$atts['post__not_in'] = !empty($atts['post__not_in']) ? wp_parse_id_list($atts['post__not_in']) : false;
$query = new WP_Query($atts);
ob_start();
if ($query->have_posts()) {
?>
have_posts()) : $query->the_post();
get_template_part('templates/content');
endwhile;
?>
'',
), $atts);
$patterns = array(
'#^\s*#',
'#\s*$#',
'#
#'
);
$acc_ID = 'acc-' . dotspice_unique_ID('accordion');
$acc_class = !empty($atts['class']) ? $atts['class'] . ' accordion' : 'accordion';
ob_start();
?>
'',
'tag' => 'h3',
'open' => false,
), $atts);
$acc_ID = 'acc-' . dotspice_unique_ID('accordion', false);
$card_ID = sanitize_title($acc_ID . '-card-' . $atts['title']);
$card_aria = boolval($atts['open']) ? 'true' : 'false';
$card_class = boolval($atts['open']) ? ' show' : '';
ob_start();
?>
%1$s>',
esc_attr($atts['tag']),
esc_attr($card_ID),
esc_attr($card_aria),
esc_html($atts['title'])
);
echo sprintf(
'
',
esc_attr($card_ID),
esc_attr($card_class),
esc_attr($acc_ID),
do_shortcode(wpautop($content))
);
?>