Esempio n. 1
0
function thb_banner($atts, $content = null)
{
    extract(shortcode_atts(array('type' => 'type1', 'banner_color' => 'transparent', 'banner_border_color' => '', 'banner_bg' => false, 'banner_height' => '300', 'banner_padding' => '30', 'enable_parallax' => false, 'parallax_speed' => '', 'alignment' => '', 'title' => '', 'subtitle' => '', 'button_text' => '', 'button_link' => '', 'overlay_link' => ''), $atts));
    $out = $parallax = $data = '';
    if ($enable_parallax) {
        if ($parallax_speed == '') {
            $parallax_speed = 1;
        }
        $parallax = 'parallax_bg';
        $data = ' data-parallax-speed="' . $parallax_speed . '"';
    }
    $img_id = preg_replace('/[^\\d]/', '', $banner_bg);
    $img = wp_get_attachment_image_src($img_id, 'full');
    $content = remove_invalid_tags($content, array('p'));
    $out .= '<aside class="banner ' . $alignment . ' ' . $type . ' ' . $parallax . '" style="border-color:' . $banner_border_color . '; min-height:' . $banner_height . 'px; background: ' . $banner_color . ' url(' . $img[0] . '); padding:' . $banner_padding . 'px;" ' . $data . '><div class="divcontent">' . ($type != 'type3' ? do_shortcode($content) : '') . '</div>';
    $out .= '<div class="divstyle" style="border-color:' . $banner_border_color . ';">';
    if ($type == 'type3') {
        $out .= '<a href="' . $button_link . '" class="btn large white" title="' . $button_text . '">' . $button_text . '</a>';
        $out .= '<h3>' . $title . '</h3>';
        $out .= '<p>' . $subtitle . '</p>';
    }
    $out .= '</div>';
    if ($type == 'type5') {
        $out .= '<a href="' . $overlay_link . '" class="overlay_link"></a>';
    }
    $out .= '</aside>';
    return $out;
}
Esempio n. 2
0
File: html.php Progetto: n1ss/acreet
function shortcode_box($atts, $content)
{
    extract(shortcode_atts(array('style' => ''), $atts));
    //remove wrong nested p tags
    $content = remove_invalid_tags($content, array('p'));
    $output = '<div class="box ' . $style . '"><div class="bg"><div class="inner">';
    $output .= do_shortcode($content);
    $output .= '</div></div></div><!-- .box (end) -->';
    return $output;
}
Esempio n. 3
0
 function grid_column($atts, $content = null, $shortcodename = "")
 {
     extract(shortcode_atts(array('class' => ''), $atts));
     //remove wrong nested <p>
     $content = remove_invalid_tags($content, array('p'));
     // add divs to the content
     $return = '<div class="' . $shortcodename . ' ' . $class . '">';
     $return .= do_shortcode($content);
     $return .= '</div>';
     return $return;
 }
function blockquotes($atts, $content = null)
{
    extract(shortcode_atts(array('pull' => '', 'author' => ''), $atts));
    $content = remove_invalid_tags($content, array('p'));
    $content = remove_invalid_tags($content, array('br'));
    $authorhtml = '';
    if ($author) {
        $authorhtml = '<cite>' . $author . '</cite>';
    }
    $out = '<blockquote class="styled ' . $pull . '"><p>' . $content . $authorhtml . '</p></blockquote>';
    return $out;
}
Esempio n. 5
0
function fluid_column($atts, $content = null, $shortcodename = "")
{
    $last = '';
    if (isset($atts[0]) && trim($atts[0]) == 'last') {
        $last = 'last';
    }
    //remove wrong nested <p>
    $content = remove_invalid_tags($content, array('p'));
    // add divs to the content
    $return .= '<div class="' . $shortcodename . ' ' . $last . '">';
    $return .= do_shortcode($content);
    $return .= '</div>';
    if ($last != '') {
        $return .= '<div class="clear"></div>';
    }
    return $return;
}
function icon_list($atts, $content = null, $code)
{
    extract(shortcode_atts(array('icon' => 'ok'), $atts));
    $content = remove_invalid_tags($content, array('p'));
    $content = remove_invalid_tags($content, array('br'));
    $output = '';
    if (!preg_match_all("/(.?)\\[(item)\\b(.*?)(?:(\\/))?\\](?:(.+?)\\[\\/item\\])?(.?)/s", $content, $matches)) {
        return do_shortcode($content);
    } else {
        for ($i = 0; $i < count($matches[0]); $i++) {
            $matches[3][$i] = shortcode_parse_atts($matches[3][$i]);
        }
        $output .= '<ul class="iconlist">';
        for ($i = 0; $i < count($matches[0]); $i++) {
            $output .= '<li><i class="icon-' . $icon . '"></i>' . do_shortcode(trim($matches[5][$i])) . '</li>';
        }
        $output .= '</ul>';
        return $output;
    }
}
Esempio n. 7
0
function five_sixth_column($atts, $content = null)
{
    //remove wrong nested <p>
    $content = remove_invalid_tags($content, array('p'));
    // add divs to the content
    $return = '<div class="span10">';
    $return .= do_shortcode($content);
    $return .= '</div>';
    return $return;
}