本文整理汇总了PHP中spb_translateColumnWidthToSpan函数的典型用法代码示例。如果您正苦于以下问题:PHP spb_translateColumnWidthToSpan函数的具体用法?PHP spb_translateColumnWidthToSpan怎么用?PHP spb_translateColumnWidthToSpan使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spb_translateColumnWidthToSpan函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
protected function content($atts, $content = null)
{
$output = $el_position = $title = $width = $el_class = $sidebar_id = '';
extract(shortcode_atts(array('el_position' => '', 'width' => '1/1', 'el_class' => '', 'sidebar_id' => ''), $atts));
if ($sidebar_id == '') {
echo 'Sidebar ID not set.';
return null;
}
$el_class = $this->getExtraClass($el_class);
ob_start();
dynamic_sidebar($sidebar_id);
$sidebar_value = ob_get_contents();
ob_end_clean();
$sidebar_value = trim($sidebar_value);
$sidebar_value = substr($sidebar_value, 0, 3) == '<li' ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value;
//
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_sidebar_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper clearfix">';
$output .= "\n\t\t\t" . $sidebar_value;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例2: content
protected function content($atts, $content = null)
{
$width = $el_class = $output = $items = $el_position = '';
extract(shortcode_atts(array("revslider_shortcode" => '', "layerslider_shortcode" => '', 'masterslider_id' => '', 'el_position' => '', 'fullwidth' => '', 'width' => '1/1', 'el_class' => ''), $atts));
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_slider_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content spb_wrapper slider-wrap">';
if ($revslider_shortcode != "") {
$output .= "\n\t\t\t\t" . sf_return_slider($revslider_shortcode);
} else {
if ($layerslider_shortcode != "") {
$output .= "\n\t\t\t\t" . do_shortcode('[layerslider id="' . $layerslider_shortcode . '"]');
} else {
if ($masterslider_id != "") {
$output .= "\n\t\t\t\t" . do_shortcode('[masterslider id="' . $masterslider_id . '"]');
}
}
}
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
if ($fullwidth == "yes") {
$output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
} else {
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
}
return $output;
}
示例3: content
protected function content($atts, $content = null)
{
$title = $asset_type = $carousel = $product_size = $width = $sidebars = $el_class = $output = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'asset_type' => 'best-sellers', 'carousel' => 'no', 'product_size' => 'standard', 'item_count' => '8', 'category' => '', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
/* PRODUCT ITEMS
================================================== */
if (sf_woocommerce_activated()) {
$items = sf_product_items($asset_type, $category, $carousel, $product_size, $item_count, $width);
} else {
$items = __("Please install/activate WooCommerce.", "swift-framework-admin");
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="product_list_widget products-' . $product_size . ' woocommerce spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
$output .= "\n\t\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
if ($carousel == "yes") {
global $sf_include_carousel;
$sf_include_carousel = true;
}
global $sf_include_isotope, $sf_has_products;
$sf_include_isotope = true;
$sf_has_products = true;
return $output;
}
示例4: content
protected function content($atts, $content = null)
{
$width = $input_class = $el_class = $output = $post_type = $search_form = $el_position = '';
extract(shortcode_atts(array('el_position' => '', 'search_input_text' => '', 'input_size' => 'standard', 'post_type' => '', 'width' => '1/1', 'twitter_username' => '', 'el_class' => ''), $atts));
if ($input_size == "large") {
$input_class = 'input-large';
} else {
$input_class = 'input-standard';
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$search_form .= '<form method="get" class="search-form search-widget" action="' . get_home_url() . '/">';
$search_form .= '<input type="text" placeholder="' . $search_input_text . '" name="s" class="' . $input_class . '" />';
if ($post_type != "any") {
$search_form .= '<input type="hidden" name="post_type" value="' . $post_type . '" />';
}
$search_form .= '</form>';
$output .= "\n\t" . '<div class="spb_search_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
$output .= "\n\t\t" . $search_form;
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例5: content
public function content($atts, $content = null)
{
$col_el_class = $width = $el_position = '';
extract(shortcode_atts(array('col_el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
$output = '';
$col_el_class = $this->getExtraClass($col_el_class);
$orig_width = $width;
$width = spb_translateColumnWidthToSpan($width);
if ($this->shortcode == 'spb_column') {
$col_el_class .= ' column_container';
} else {
if ($this->shortcode == 'spb_text_block') {
$col_el_class .= ' spb_text_column';
}
}
global $column_width;
if ($orig_width != "") {
$column_width = $orig_width;
}
$output .= "\n\t" . '<div class="spb_content_element ' . $width . $col_el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper">';
$output .= "\n\t\t\t" . spb_format_content($content);
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$column_width = "";
$output = $this->startRow($el_position, $orig_width) . $output . $this->endRow($el_position, 'column');
return $output;
}
示例6: content
public function content($atts, $content = null)
{
$title = $el_class = $text_color = $image_url = $image_object = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'character' => '', 'image' => '', 'animation' => '', 'animation_delay' => '', 'box_type' => '', 'color' => '', 'link' => '', 'target' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
$output = '';
if ($image != "") {
$img_url = wp_get_attachment_url($image, 'full');
$image_oject = array();
if (function_exists('sf_aq_resize')) {
$image_object = sf_aq_resize($img_url, 70, 70, true, false);
}
$image_url = $image_object[0];
}
$icon_box_output = do_shortcode('[sf_iconbox character="' . $character . '" image="' . $image . '" color="standard" type="' . $box_type . '" title="' . $title . '" animation="' . $animation . '" animation_delay="' . $animation_delay . '" color="' . $color . '" link="' . $link . '" target="' . $target . '"]' . $content . '[/sf_iconbox]');
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_icon_box ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper box-wrap">';
$output .= "\n\t\t\t" . $icon_box_output;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
global $sf_include_carousel;
$sf_include_carousel = true;
return $output;
}
示例7: content
public function content($atts, $content = null)
{
$title = $el_class = $text_color = $image_url = $image_object = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'icon' => '', 'character' => '', 'image' => '', 'box_type' => '', 'icon_color' => '', 'icon_bg_color' => '', 'text_color' => '', 'bg_color' => '', 'flip_text_color' => '', 'flip_bg_color' => '', 'animation' => '', 'animation_delay' => '', 'link' => '', 'target' => '_self', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
$has_image = false;
$output = $icon_box = '';
if ($target == "") {
$target = "_self";
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_icon_box ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
if ($link != "") {
$output .= '<a class="box-link" href="' . $link . '" target="' . $target . '"></a>';
}
$output .= "\n\t\t\t" . '<div class="sf-icon-box-content-wrap clearfix">';
$output .= "\n\t\t\t\t" . '<div class="sf-icon-box-inner-wrap clearfix">';
$output .= "\n\t\t\t\t\t" . '<div class="grid-icon-wrap clearfix">' . do_shortcode('[sf_icon size="medium" svg="' . $icon . '" character="' . $character . '" image="' . $image . '" float="none" cont="no" color="' . $icon_color . '" bgcolor="' . $icon_bg_color . '" link="' . $link . '" target="' . $target . '"]') . '</div>';
$output .= "\n\t\t\t\t\t" . '<div class="divider-line"></div>';
$output .= "\n\t\t\t\t\t" . '<h3>' . $title . '</h3>';
$output .= "\n\t\t\t\t" . '</div>';
$output .= "\n\t\t\t" . '</div>';
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
global $sf_include_carousel;
$sf_include_carousel = true;
return $output;
}
示例8: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $output = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'fullwidth' => '', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
/* PAGE BUILDER OUTPUT
================================================== */
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
if ($fullwidth == "yes" && $width == "col-sm-12") {
$fullwidth = true;
} else {
$fullwidth = false;
}
$output .= "\n\t" . '<div class="spb_supersearch_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
$output .= $title != '' ? "\n\t\t\t" . $this->spb_title($title, '', $fullwidth) : '';
$output .= "\n\t\t" . do_shortcode('[sf_supersearch]');
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
if ($fullwidth == "yes") {
$output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
} else {
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
}
return $output;
}
示例9: content
public function content($atts, $content = null)
{
$title = $el_class = $title_heading_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'alt_background' => 'none', 'el_class' => '', 'el_position' => '', 'width' => '1/1'), $atts));
$output = '';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$el_class .= ' spb_text_column';
$sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
$sidebars = '';
if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
if ($alt_background == "none" || $sidebars != "no-sidebars") {
$output .= "\n\t" . '<div class="full-width-text spb_content_element ' . $width . $el_class . '">';
$title_heading_class = "spb-text-heading";
} else {
$output .= "\n\t" . '<div class="full-width-text spb_content_element alt-bg ' . $alt_background . ' ' . $width . $el_class . '">';
$title_heading_class = "spb-center-heading";
}
$output .= "\n\t\t" . '<div class="spb_wrapper clearfix">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading ' . $title_heading_class . '"><span>' . $title . '</span></h3></div>' : '';
$output .= "\n\t\t\t" . do_shortcode($content);
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例10: content
protected function content($atts, $content = null)
{
$width = $pb_margin_bottom = $pb_border_bottom = $pb_border_top = $el_class = $output = $search_form = $el_position = '';
extract(shortcode_atts(array('el_position' => '', 'search_input_text' => '', 'pb_margin_bottom' => 'no', 'pb_border_bottom' => 'no', 'pb_border_top' => 'no', 'width' => '1/1', 'twitter_username' => '', 'el_class' => ''), $atts));
if ($pb_margin_bottom == "yes") {
$el_class .= ' pb-margin-bottom';
}
if ($pb_border_bottom == "yes") {
$el_class .= ' pb-border-bottom';
}
if ($pb_border_top == "yes") {
$el_class .= ' pb-border-top';
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$search_form .= '<form method="get" class="search-form search-widget" action="' . get_home_url() . '/">';
$search_form .= '<input type="text" placeholder="' . $search_input_text . '" name="s" />';
$search_form .= '</form>';
$output .= "\n\t" . '<div class="spb_search_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper latest-tweet-bar-wrap clearfix">';
$output .= "\n\t\t\t" . $search_form;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例11: content
public function content($atts, $content = null)
{
$title = $order = $text_size = $items = $el_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'twitter_username' => '', 'text_size' => 'normal', 'tweets_count' => '6', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1'), $atts));
$output = '';
if ($autoplay == "yes") {
$items .= '<div class="flexslider tweets-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides">';
} else {
$items .= '<div class="flexslider tweets-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides">';
}
$items .= sf_get_tweets($twitter_username, $tweets_count);
$items .= '</ul></div>';
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$el_class .= ' testimonial';
if ($alt_background == "none") {
$output .= "\n\t" . '<div class="spb_tweets_slider_widget ' . $width . $el_class . '">';
} else {
$output .= "\n\t" . '<div class="spb_tweets_slider_widget alt-bg ' . $alt_background . ' ' . $width . $el_class . '">';
}
$output .= "\n\t\t" . '<div class="spb_wrapper slider-wrap text-' . $text_size . '">';
$output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>' : '';
$output .= "\n\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
global $sf_include_carousel;
$sf_include_carousel = true;
return $output;
}
示例12: content
protected function content($atts, $content = null)
{
$btn_color = $btn_text = $display_type = $target = $href = $promo_bar_text = $fullwidth = $inline_style = $inline_style_alt = $width = $position = $el_class = '';
extract(shortcode_atts(array('btn_color' => 'accent', 'btn_text' => '', 'btn_type' => 'dropshadow', 'target' => '', 'display_type' => '', 'href' => '', 'shadow' => 'yes', 'promo_bar_text' => '', 'content' => '', 'promo_bar_text_size' => '', 'width' => '1/1', 'bg_color' => '', 'text_color' => '', 'fullwidth' => 'no', 'el_class' => '', 'el_position' => ''), $atts));
$output = '';
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
$sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
$sidebars = '';
if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
if ($bg_color != "") {
$inline_style .= 'background-color:' . $bg_color . ';';
}
if ($text_color != "") {
$inline_style_alt .= 'color:' . $text_color . ';';
}
// Button type
$btn_type = str_replace("_", " ", $btn_type);
if ($target == 'same' || $target == '_self') {
$target = '_self';
}
if ($target != '') {
$target = $target;
}
$next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
$output .= '<div class="spb-promo-wrap spb_content_element clearfix ' . $width . ' ' . $position . $el_class . '">' . "\n";
$output .= '<div class="sf-promo-bar ' . $display_type . '" style="' . $inline_style . '">';
if ($display_type == "promo-button") {
$output .= '<p class="' . $promo_bar_text_size . '" style="' . $inline_style_alt . '">' . $promo_bar_text . '</p>';
$output .= '<a href="' . $href . '" target="' . $target . '" class="sf-button ' . $btn_type . ' ' . $btn_color . '">' . $btn_text . '</a>';
} else {
if ($display_type == "promo-arrow") {
$output .= '<a href="' . $href . '" target="' . $target . '" style="' . $inline_style_alt . '"><p>' . $promo_bar_text . '</p>' . $next_icon . '</a>';
} else {
if ($display_type == "promo-text") {
$output .= '<a href="' . $href . '" target="' . $target . '" class="' . $promo_bar_text_size . '" style="' . $inline_style_alt . '"><p>' . do_shortcode($promo_bar_text) . '</p></a>';
} else {
$output .= '<p>' . do_shortcode($content) . '</p>';
}
}
}
$output .= '</div>';
$output .= '</div> ' . $this->endBlockComment('.spb-promo-wrap') . "\n";
if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
$output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
} else {
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
}
return $output;
}
示例13: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $exclude_categories = $output = $tax_terms = $hover_style = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'display_type' => 'standard', 'link_type' => 'lightbox', 'fullwidth' => 'no', 'gutters' => 'yes', 'columns' => '4', 'show_title' => 'yes', 'show_subtitle' => 'yes', 'show_excerpt' => 'no', "excerpt_length" => '20', 'item_count' => '-1', 'category' => '', 'gallery_filter' => 'yes', 'pagination' => 'no', 'hover_style' => 'default', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
/* SIDEBAR CONFIG
================================================== */
global $sf_sidebar_config;
$sidebars = '';
if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sf_sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
/* GALLERIES
================================================== */
$items = sf_galleries($display_type, $link_type, $fullwidth, $gutters, $columns, $show_title, $show_subtitle, $show_excerpt, $excerpt_length, $item_count, $category, $pagination, $sidebars, $hover_style);
/* PAGE BUILDER OUTPUT
================================================== */
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
$title_wrap_class = "";
if ($gallery_filter == "yes") {
$title_wrap_class .= 'has-filter ';
}
if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
$title_wrap_class .= 'container ';
}
$output .= "\n\t" . '<div class="spb_galleries_widget galleries-wrap spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb-asset-content">';
if ($title != '' || $gallery_filter == "yes") {
$output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">';
if ($title != '') {
$output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>';
}
if ($gallery_filter == "yes") {
$output .= sf_gallery_filter('', $category);
}
$output .= '</div>';
}
$output .= "\n\t\t" . $items;
$output .= "\n\t\t" . '</div>';
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
if ($fullwidth == "yes" && $sidebars == "no-sidebars") {
$output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true);
} else {
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
}
global $sf_include_isotope, $sf_has_galleries;
$sf_include_isotope = true;
$sf_has_galleries = true;
return $output;
}
示例14: content
public function content($atts, $content = null)
{
$title = $job_text = $order = $view_all_link = $output = $items = $el_class = $width = $el_position = '';
extract(shortcode_atts(array('title' => '', 'job_text' => '', 'item_count' => '-1', 'order' => '', 'category' => '', 'view_all_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts));
// CATEGORY SLUG MODIFICATION
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
// JOBS QUERY SETUP
global $post, $wp_query;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$jobs_args = array('orderby' => $order, 'post_type' => 'jobs', 'post_status' => 'publish', 'paged' => $paged, 'jobs-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
$jobs = new WP_Query($jobs_args);
$count = 0;
$items .= '<ul class="jobs-overview clearfix">';
// JOBS LOOP
while ($jobs->have_posts()) {
$jobs->the_post();
$job_title = get_the_title();
$job_permalink = get_permalink();
$items .= '<li class="job"><a href="' . $job_permalink . '">' . $job_title . '</a></li>';
$count++;
}
wp_reset_postdata();
$items .= '</ul>';
if ($view_all_link == "yes") {
$options = get_option('sf_dante_options');
$jobs_page = __($options['jobs_page'], 'swiftframework');
if ($jobs_page) {
$jobs_page_title = get_page_by_path($jobs_page);
if (isset($jobs_page_title)) {
$jobs_page_id = $jobs_page_title->ID;
}
}
if ($jobs_page && isset($jobs_page_title)) {
$items .= '<a href="' . get_permalink($jobs_page_id) . '" class="read-more">' . __("View all vacancies", "swiftframework") . ' [' . $current_jobs . ']</a>';
}
}
$el_class = $this->getExtraClass($el_class);
$width = spb_translateColumnWidthToSpan($width);
$output .= "\n\t" . '<div class="spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper jobs-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading">' . $title . '</h3>' : '';
$output .= "\n\t\t\t" . "<p>" . $job_text . "</p>";
$output .= "\n\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
//
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
return $output;
}
示例15: content
protected function content($atts, $content = null)
{
$title = $width = $el_class = $filter_output = $exclude_categories = $output = $tax_terms = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', 'display_type' => 'standard', 'columns' => '4', 'show_title' => 'yes', 'show_subtitle' => 'yes', 'show_excerpt' => 'no', 'hover_show_excerpt' => 'no', "excerpt_length" => '20', 'item_count' => '-1', 'category' => '', 'portfolio_filter' => 'yes', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
/* for PRO users! - SIDEBAR CONFIG
================================================== */
$sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
$sidebars = '';
if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
$sidebars = 'one-sidebar';
} else {
if ($sidebar_config == "both-sidebars") {
$sidebars = 'both-sidebars';
} else {
$sidebars = 'no-sidebars';
}
}
/* for PRO users! - PORTFOLIO FILTER
================================================== */
if ($portfolio_filter == "yes" && $sidebars == "no-sidebars") {
if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
$filter_output = sf_portfolio_filter('full-width', $category);
} else {
$filter_output = sf_portfolio_filter('', $category);
}
}
/* for PRO users! - PORTFOLIO ITEMS
================================================== */
$items = sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars);
/* for PRO users! - PAGE BUILDER OUTPUT
================================================== */
$width = spb_translateColumnWidthToSpan($width);
$el_class = $this->getExtraClass($el_class);
$output .= "\n\t" . '<div class="spb_portfolio_widget spb_content_element ' . $width . $el_class . '">';
$output .= "\n\t\t" . '<div class="spb_wrapper portfolio-wrap">';
$output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : '';
if ($filter_output != "") {
$output .= "\n\t\t\t" . $filter_output;
}
$output .= "\n\t\t\t" . $items;
$output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
$output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
if ($display_type == "masonry-fw" || $display_type == "masonry-gallery-fw") {
$output = $this->startRow($el_position, '', true, "full-width") . $output . $this->endRow($el_position, '', true);
} else {
$output = $this->startRow($el_position) . $output . $this->endRow($el_position);
}
global $sf_include_isotope;
$sf_include_isotope = true;
global $sf_has_portfolio;
$sf_has_portfolio = true;
return $output;
}