Example #1
0
 function query($atts, $content = null)
 {
     $default = array('post_type' => 'staff', 'limit' => -1, 'pagination' => false, 'callback' => array($this, 'generate_item'), 'row' => false, 'columns' => 4);
     $atts = wp_parse_args($atts, $default);
     if ($content) {
         return token_repalce($content, spyropress_query_generator($atts));
     }
     return spyropress_query_generator($atts);
 }
Example #2
0
 function query($atts, $content = null)
 {
     $default = array('post_type' => 'testimonial', 'limit' => -1, 'row' => false, 'columns' => false, 'pagination' => false, 'callback' => array($this, 'generate_item'));
     $atts = wp_parse_args($atts, $default);
     if (!empty($atts['cat'])) {
         $atts['tax_query']['relation'] = 'OR';
         if (!empty($atts['cat'])) {
             $atts['tax_query'][] = array('taxonomy' => 'testimonial_category', 'field' => 'slug', 'terms' => $atts['cat']);
             unset($atts['cat']);
         }
     }
     if ($content) {
         return token_repalce($content, spyropress_query_generator($atts));
     }
     return spyropress_query_generator($atts);
 }
function spyropress_sc_bar($atts = array(), $content = '')
{
    $default = array('progress' => '60', 'cls' => '', 'animate' => false, 'delay' => '', 'style' => '');
    extract(shortcode_atts($default, $atts));
    //class
    $class = array('progress-bar');
    if ('' != $cls) {
        $class[] = 'progress-bar-' . $cls;
    }
    // style
    $styles = array('striped' => 'progress-striped', 'animated' => 'progress-striped active');
    $class2 = array('progress');
    if ('' != $style) {
        $class2[] = $styles[$style];
    }
    $tmpl = '{label}<div class="{class2}"><div class="{class}"{animate}{delay}{width}>{title}{tooltip}</div></div>';
    $args = array('label' => $content ? '<div class="progress-label"><span>' . $content . '</span></div>' : '', 'class' => spyropress_clean_cssclass($class), 'class2' => spyropress_clean_cssclass($class2), 'animate' => $animate ? ' data-appear-progress-animation="' . $progress . '%"' : '', 'delay' => $delay ? ' data-appear-animation-delay="' . $delay . '"' : '', 'tooltip' => $animate ? '<span class="progress-bar-tooltip">' . $progress . '%</span>' : '', 'width' => !$animate ? ' style="width:' . $progress . '%;"' : '');
    return token_repalce($tmpl, $args);
}
function get_placeholder_img_url($width = 0, $height = 0)
{
    $args = array('bg' => get_setting('no_image_bg', '#eeeeee'), 'color' => get_setting('no_image_color', '#888888'), 'text' => get_setting('no_image_text', 'No Image Found'), 'width' => $width, 'height' => $height);
    $args = apply_filters('spyropress_placeholder_img_args', spyropress_clean_array($args));
    // Setting dimension
    $wh = wp_constrain_dimensions(999, 999, $width, $height);
    $args['width'] = $wh[0];
    $args['height'] = $wh[1];
    $tmpl = 'holder.js/{width}x{height}/{bg}:{color}/text:{text}';
    return token_repalce($tmpl, $args);
}