本文整理汇总了PHP中sf_theme_supports函数的典型用法代码示例。如果您正苦于以下问题:PHP sf_theme_supports函数的具体用法?PHP sf_theme_supports怎么用?PHP sf_theme_supports使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sf_theme_supports函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_template_directory_uri
/css/iconfont.css" rel="stylesheet" type="text/css"/>
<?php
}
?>
<?php
if (sf_theme_supports('icon-mind-font')) {
?>
<link href="<?php
echo get_template_directory_uri();
?>
/css/iconmind.css" rel="stylesheet" type="text/css"/>
<?php
}
?>
<?php
if (sf_theme_supports('gizmo-icon-font')) {
?>
<link href="<?php
echo get_template_directory_uri();
?>
/css/ss-gizmo.css" rel="stylesheet" type="text/css"/>
<?php
}
?>
<link href="<?php
echo get_template_directory_uri();
?>
/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<link href="<?php
echo $fontello_icons_path;
示例2: sf_page_heading
//.........这里部分代码省略.........
$show_page_title = $default_show_page_heading;
}
if ($page_title == "") {
$page_title = get_the_title();
}
if ($page_title_height == "") {
$page_title_height = apply_filters('sf_shop_fancy_page_height', 300);
}
// Fancy heading image
if (($page_title_style == "fancy" || $page_title_style == "fancy-tabbed") && $fancy_title_image_url == "") {
foreach ($fancy_title_image as $detail_image) {
if (isset($detail_image['url'])) {
$fancy_title_image_url = $detail_image['url'];
break;
}
}
if (!$fancy_title_image) {
$fancy_title_image = get_post_thumbnail_id();
$fancy_title_image_url = wp_get_attachment_url($fancy_title_image, 'full');
}
}
// Page Title Hidden
if (!$show_page_title) {
$page_heading_el_class = "page-heading-hidden";
}
// Breadcrumb in heading
if ($breadcrumb_in_heading) {
$page_heading_el_class .= " page-heading-breadcrumbs";
}
if ($page_title_style == "fancy-tabbed") {
$page_title_text_align = "left";
}
// Return if product & inner heading
if (function_exists('is_product') && is_product() && sf_theme_supports('product-inner-heading') && ($page_title_style == "standard" || $page_title_style == "")) {
return;
}
// Dont' allow fancy-tabbed on product pages
if (function_exists('is_product') && is_product() && sf_theme_supports('product-inner-heading') && $page_title_style == "fancy-tabbed") {
$page_title_style = "fancy";
}
if ($page_title_style == "fancy" && sf_theme_opts_name() == "sf_atelier_options" && !(function_exists('is_product') && is_product())) {
$extra_styles = 'height: ' . $page_title_height . 'px;';
}
if (isset($sf_options['minimal_checkout'])) {
if (function_exists('is_checkout') && is_checkout()) {
global $woocommerce;
if ($sf_options['minimal_checkout']) {
?>
<div class="minimal-checkout-return container"><a href="<?php
echo esc_url($woocommerce->cart->get_cart_url());
?>
"><?php
_e("Return to cart", "swiftframework");
?>
</a></div>
<?php
}
}
}
if (!is_home()) {
?>
<?php
if ($page_title_style == "fancy" || $page_title_style == "fancy-tabbed") {
?>
示例3: content
//.........这里部分代码省略.........
if ($custom_excerpt != "") {
$member_bio = sf_custom_excerpt($custom_excerpt, 1000);
} else {
$member_bio = apply_filters('the_content', get_the_content(''));
}
}
$member_email = sf_get_post_meta($postID, 'sf_team_member_email', true);
$member_phone = sf_get_post_meta($postID, 'sf_team_member_phone_number', true);
$member_twitter = sf_get_post_meta($postID, 'sf_team_member_twitter', true);
$member_facebook = sf_get_post_meta($postID, 'sf_team_member_facebook', true);
$member_linkedin = sf_get_post_meta($postID, 'sf_team_member_linkedin', true);
$member_google_plus = sf_get_post_meta($postID, 'sf_team_member_google_plus', true);
$member_skype = sf_get_post_meta($postID, 'sf_team_member_skype', true);
$member_instagram = sf_get_post_meta($postID, 'sf_team_member_instagram', true);
$member_dribbble = sf_get_post_meta($postID, 'sf_team_member_dribbble', true);
$view_profile_text = __("View Profile", 'swift-framework-plugin');
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
$item_icon = apply_filters('sf_team_hover_icon', "fa-pencil");
$item_svg_icon = apply_filters('sf_team_hover_svg_icon', "");
$thumb_img_url = "";
foreach ($thumb_image as $detail_image) {
$thumb_image_id = $detail_image['ID'];
$thumb_img_url = $detail_image['url'];
break;
}
if (!$thumb_image) {
$thumb_image = get_post_thumbnail_id();
$thumb_image_id = $thumb_image;
$thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
}
$image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false);
// Output
$items .= '<div itemscope data-id="id-' . $count . '" class="clearfix team-member ' . $item_class . '">';
if (sf_theme_supports('minimal-team-hover')) {
$items .= '<div class="team-member-item-wrap">';
}
$items .= '<figure class="animated-overlay">';
if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") {
$items .= '<a class="team-member-link ' . $team_member_link_class . '" href="' . get_permalink() . '" data-id="' . $postID . '"></a>';
}
if ($display_type == "gallery") {
$items .= '<a class="team-gallery-mobile-link" href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '"></a>';
}
if ($image) {
$items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $member_name . '" />';
}
$items .= '<figcaption class="team-' . $display_type . '">';
if (sf_theme_supports('minimal-team-hover') && $display_type != "gallery") {
$items .= '<div class="thumb-info thumb-info-alt">';
if ($item_svg_icon != "") {
$items .= $item_svg_icon;
} else {
$items .= '<i class="' . $item_icon . '"></i>';
}
$items .= '</div>';
} else {
$items .= '<div class="thumb-info">';
if ($display_type == "gallery") {
if ($profile_link == "yes") {
$items .= '<h4 class="team-member-name"><a href="' . get_permalink() . '" class="' . $team_member_link_class . '" data-id="' . $postID . '">' . $member_name . '</a></h4>';
} else {
$items .= '<h4 class="team-member-name">' . $member_name . '</h4>';
}
$items .= '<h5 class="team-member-position">' . $member_position . '</h5>';
$items .= '<div class="name-divide"></div>';
}
示例4: sf_nextprev_navigation
function sf_nextprev_navigation()
{
global $sf_options;
// Pagiantion style
$pagination_style = "standard";
if (isset($sf_options['pagination_style'])) {
$pagination_style = $sf_options['pagination_style'];
}
// Portfolio category navigation
$enable_category_navigation = $sf_options['enable_category_navigation'];
if (!(is_singular('post') || is_singular('portfolio') || is_singular('product')) || $pagination_style != "fs-arrow" || !sf_theme_supports('fullscreen-pagination')) {
return;
}
$taxonomy = "category";
if (is_singular('portfolio')) {
$taxonomy = "portfolio-category";
} else {
if (is_singular('product')) {
$taxonomy = "product_cat";
}
}
// Get next/prev post
$prev_post = get_next_post($enable_category_navigation, '', $taxonomy);
$next_post = get_previous_post($enable_category_navigation, '', $taxonomy);
$sf_prev_icon = apply_filters('sf_prev_icon', '<i class="ss-navigateleft"></i>');
$sf_next_icon = apply_filters('sf_next_icon', '<i class="ss-navigateright"></i>');
if (!empty($prev_post)) {
$postID = $prev_post->ID;
$prev_permalink = get_permalink($postID);
$item_subtitle = sf_get_post_meta($postID, 'sf_portfolio_subtitle', true);
$use_thumb_content = sf_get_post_meta($postID, 'sf_thumbnail_content_main_detail', true);
$image = $media_image_url = $image_id = "";
if ($use_thumb_content) {
$media_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $postID);
} else {
$media_image = rwmb_meta('sf_detail_image', 'type=image&size=full', $postID);
}
foreach ($media_image as $detail_image) {
$image_id = $detail_image['ID'];
$media_image_url = $detail_image['url'];
break;
}
if (!$media_image) {
$media_image = get_post_thumbnail_id($postID);
$image_id = $media_image;
$media_image_url = wp_get_attachment_url($media_image, 'full');
}
$detail_image = sf_aq_resize($media_image_url, 80, 80, true, false);
$image_alt = sf_get_post_meta($image_id, '_wp_attachment_image_alt', true);
if ($detail_image) {
$image = '<img itemprop="image" src="' . $detail_image[0] . '" width="' . $detail_image[1] . '" height="' . $detail_image[2] . '" alt="' . $image_alt . '" />';
}
?>
<?php
if ($image != "") {
?>
<div id="prev-article-pagination" class="window-arrow-nav prev-item has-img">
<?php
} else {
?>
<div id="prev-article-pagination" class="window-arrow-nav prev-item">
<?php
}
?>
<a href="<?php
echo esc_url($prev_permalink);
?>
">
<div class="nav-transition">
<div class="overlay-wrap">
<?php
echo esc_html($sf_prev_icon);
?>
<?php
if ($image != "") {
?>
<figure class="pagination-article-image">
<?php
echo esc_html($image);
?>
</figure>
<?php
}
?>
</div>
</div>
<?php
if ($item_subtitle != "") {
?>
<div class="pagination-article-details has-subtitle">
<h5><?php
echo esc_attr($prev_post->post_title);
?>
</h5>
<p><?php
echo esc_attr($item_subtitle);
?>
//.........这里部分代码省略.........
示例5: start_el
//.........这里部分代码省略.........
<p class="field-custom description description-wide">
<label
for="edit-menu-loggedoutvis-<?php
echo esc_attr($item_id);
?>
"><?php
_e('Visible only when logged out', 'swiftframework');
?>
<input type="checkbox" id="edit-menu-loggedoutvis-<?php
echo esc_attr($item_id);
?>
"
class="edit-menu-item-custom" id="menu-loggedoutvis[<?php
echo esc_attr($item_id);
?>
]"
name="menu-loggedoutvis[<?php
echo esc_attr($item_id);
?>
]"
value="1" <?php
echo checked(!empty($item->loggedoutvis), 1, false);
?>
/>
</label>
</p>
<?php
if ($depth == 0) {
?>
<?php
if (sf_theme_supports('menu-new-badge')) {
?>
<p class="field-custom description description-wide">
<label
for="edit-menu-newbadge-<?php
echo esc_attr($item_id);
?>
"><?php
_e('New Badge', 'swiftframework');
?>
<input type="checkbox" id="edit-menu-newbadge-<?php
echo esc_attr($item_id);
?>
"
class="edit-menu-item-custom" id="menu-newbadge[<?php
echo esc_attr($item_id);
?>
]"
name="menu-newbadge[<?php
echo esc_attr($item_id);
?>
]"
value="1" <?php
echo checked(!empty($item->newbadge), 1, false);
?>
/>
</label>
</p>
<?php
}
?>
示例6: sf_mobile_header
function sf_mobile_header()
{
global $woocommerce, $sf_options;
$mobile_header_layout = $sf_options['mobile_header_layout'];
$mobile_top_text = __($sf_options['mobile_top_text'], 'swiftframework');
$mobile_menu_icon = apply_filters('sf_mobile_menu_icon', '<span class="menu-bars"></span>');
$mobile_cart_icon = apply_filters('sf_mobile_cart_icon', '<i class="ss-cart"></i>');
$mobile_show_cart = $sf_options['mobile_show_cart'];
$mobile_header_class = "";
$mobile_header_output = "";
if (sf_theme_supports('hamburger-css')) {
$mobile_menu_type = "slideout";
$hamburger_class = 'hamburger--3dx';
if (isset($sf_options['mobile_menu_type'])) {
$mobile_menu_type = $sf_options['mobile_menu_type'];
}
if ($mobile_menu_type == "overlay") {
$hamburger_class = 'hamburger--3dy';
}
$mobile_menu_link = '<button class="hamburger mobile-menu-link ' . $hamburger_class . '" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>';
} else {
$mobile_menu_link = '<a href="#" class="mobile-menu-link menu-bars-link">' . $mobile_menu_icon . '</a>';
}
$mobile_cart_link = '<a href="#" class="mobile-cart-link">' . $mobile_cart_icon . '</a>';
if (sf_theme_opts_name() == "sf_atelier_options" || sf_theme_opts_name() == "sf_uplift_options") {
$mobile_cart_link = '<nav class="std-menu float-alt-menu">' . "\n";
$mobile_cart_link .= '<ul class="menu">' . "\n";
$mobile_cart_link .= sf_get_cart();
$mobile_cart_link .= '</ul>' . "\n";
$mobile_cart_link .= '</nav>' . "\n";
}
if ($mobile_top_text != "") {
$mobile_header_output .= '<div id="mobile-top-text">' . do_shortcode($mobile_top_text) . '</div>';
}
$mobile_header_output .= '<header id="mobile-header" class="mobile-' . $mobile_header_layout . ' clearfix">' . "\n";
if ($mobile_header_layout == "right-logo") {
$mobile_header_output .= '<div class="mobile-header-opts">';
$mobile_header_output .= $mobile_menu_link . "\n";
if ($mobile_show_cart && $woocommerce != "") {
$mobile_header_output .= $mobile_cart_link . "\n";
}
$mobile_header_output .= '</div>';
$mobile_header_output .= sf_logo('logo-right', 'mobile-logo');
} else {
if ($mobile_header_layout == "center-logo") {
$mobile_header_output .= '<div class="mobile-header-opts opts-left">';
$mobile_header_output .= $mobile_menu_link . "\n";
$mobile_header_output .= '</div>';
$mobile_header_output .= sf_logo('logo-center', 'mobile-logo');
$mobile_header_output .= '<div class="mobile-header-opts opts-right">';
if ($mobile_show_cart && $woocommerce != "") {
$mobile_header_output .= $mobile_cart_link . "\n";
}
$mobile_header_output .= '</div>';
} else {
if ($mobile_header_layout == "center-logo-alt") {
$mobile_header_output .= '<div class="mobile-header-opts opts-left">';
if ($mobile_show_cart && $woocommerce != "") {
$mobile_header_output .= $mobile_cart_link . "\n";
}
$mobile_header_output .= '</div>';
$mobile_header_output .= sf_logo('logo-center', 'mobile-logo');
$mobile_header_output .= '<div class="mobile-header-opts opts-right">';
$mobile_header_output .= $mobile_menu_link . "\n";
$mobile_header_output .= '</div>';
} else {
$mobile_header_output .= sf_logo('logo-left', 'mobile-logo');
$mobile_header_output .= '<div class="mobile-header-opts">';
$mobile_header_output .= $mobile_menu_link . "\n";
if ($mobile_show_cart && $woocommerce != "") {
$mobile_header_output .= $mobile_cart_link . "\n";
}
$mobile_header_output .= '</div>';
}
}
}
$mobile_header_output .= '</header>' . "\n";
echo $mobile_header_output;
}
示例7: sf_page_classes
//.........这里部分代码省略.........
$page_class .= "page-transitions page-transition-" . $page_transition . " ";
if ($page_transition == "loading-bar") {
$page_class .= "loading-bar-transition ";
}
}
// Page Style
if ($page_design_style != "") {
$page_class .= $page_design_style . ' ';
}
// Header Shadow
if ($enable_header_shadow) {
$page_class .= "header-shadow ";
}
// Product Shadow
if ($product_image_shadows) {
$page_class .= "product-shadows ";
}
// Page Header Type
if ($page_header_type != "") {
$page_class .= 'header-' . $page_header_type . ' ';
}
// Page Header Logo
if ($page_header_alt_logo) {
$page_class .= 'logo-alt-version ';
}
if (is_singular('post') && $post) {
$post_header_type = sf_get_post_meta($post->ID, 'sf_page_header_type', true);
$fw_media_display = sf_get_post_meta($post->ID, 'sf_fw_media_display', true);
$page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true);
if ($page_title_style == "fancy" || $fw_media_display == "fw-media-title" || $fw_media_display == "fw-media") {
$page_class .= 'header-' . $post_header_type . ' ';
}
}
if (function_exists('is_product') && is_product()) {
$product_layout = sf_get_post_meta($post->ID, 'sf_product_layout', true);
$page_class .= 'product-' . $product_layout . ' ';
}
// Layout
if (isset($_GET['layout'])) {
$page_layout = $_GET['layout'];
}
$page_class .= "layout-" . $page_layout . " ";
// Article Swipe
if ($enable_articleswipe) {
$page_class .= 'article-swipe ';
}
if ($home_preloader && (is_home() || is_front_page()) && !is_paged()) {
$page_class .= 'sf-preloader ';
}
if ($enable_newsletter_sub_bar && (is_home() || is_front_page()) && !is_paged() || $enable_newsletter_sub_bar_page) {
$page_class .= 'has-newsletter-bar ';
}
// Page Heading
if ($post && is_singular()) {
$show_page_title = sf_get_post_meta($post->ID, 'sf_page_title', true);
$remove_breadcrumbs = sf_get_post_meta($post->ID, 'sf_no_breadcrumbs', true);
$page_title_style = sf_get_post_meta($post->ID, 'sf_page_title_style', true);
if (function_exists('is_product') && is_product() && sf_theme_supports('product-inner-heading') && $page_title_style == "fancy-tabbed") {
$page_title_style = "fancy";
}
if ($show_page_title) {
$page_class .= 'page-heading-' . $page_title_style . ' ';
}
}
$shop_page = false;
if (function_exists('is_shop') && is_shop() || function_exists('is_product_category') && is_product_category()) {
$shop_page = true;
}
if ($shop_page) {
$show_page_title = $sf_options['woo_show_page_heading'];
$page_title_style = $sf_options['woo_page_heading_style'];
if ($show_page_title) {
$page_class .= 'page-heading-' . $page_title_style . ' ';
}
}
if (sf_woocommerce_activated()) {
if (isset($sf_options['shop_icon_style'])) {
$shop_icon_style = $sf_options['shop_icon_style'];
}
$page_class .= 'shop-icon-' . $shop_icon_style . ' ';
if (isset($sf_options['minimal_checkout'])) {
if ($sf_options['minimal_checkout']) {
$page_class .= 'minimal-checkout ';
}
}
}
if ($sf_options['disable_mobile_animations']) {
$page_class .= "disable-mobile-animations ";
}
$global_filters = false;
if (isset($sf_options['enable_woo_global_filters'])) {
$global_filters = $sf_options['enable_woo_global_filters'];
if ($global_filters) {
$page_class .= 'woo-global-filters-enabled ';
}
}
// Return array of classes
$class_array = array("page-layout" => $page_layout, "page" => $page_class, "header-layout" => $header_layout, "header-wrap" => $header_wrap_class, "logo" => $logo_class, "search-type" => $header_search_type);
return $class_array;
}
示例8: sf_portfolio_thumbnail
//.........这里部分代码省略.........
}
foreach ($thumb_image as $detail_image) {
$thumb_image_id = $detail_image['ID'];
$thumb_img_url = $detail_image['url'];
break;
}
if (!$thumb_image) {
$thumb_image = get_post_thumbnail_id();
$thumb_image_id = $thumb_image;
$thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
}
$thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
$image_alt = esc_attr(sf_get_post_meta($thumb_image_id, '_wp_attachment_image_alt', true));
$item_title = get_the_title();
$item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
$permalink = get_permalink();
$item_link = sf_portfolio_item_link();
$custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
$post_excerpt = '';
if ($custom_excerpt != '') {
$post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
} else {
$post_excerpt = sf_excerpt($excerpt_length);
}
if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
$portfolio_thumb .= '<figure class="animated-overlay overlay-style">' . "\n";
} else {
$portfolio_thumb .= '<figure class="animated-overlay overlay-alt">' . "\n";
}
if ($thumb_type == "video") {
$video = sf_video_embed($thumb_video, $thumb_width, $video_height);
$portfolio_thumb .= '<div class="video-thumb">' . $video . '</div>';
} else {
if ($thumb_type == "slider") {
$portfolio_thumb .= '<div class="flexslider thumb-slider"><ul class="slides">' . "\n";
foreach ($thumb_gallery as $image) {
$portfolio_thumb .= "<li><a " . $item_link['config'] . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a></li>" . "\n";
}
$portfolio_thumb .= '</ul></div>' . "\n";
} else {
if ($thumb_type == "image" && $thumb_img_url == "") {
$thumb_img_url = "default";
}
$image = sf_aq_resize($thumb_img_url, $thumb_width, $thumb_height, true, false);
if ($image) {
$portfolio_thumb .= '<a ' . $item_link['config'] . '></a>';
if ($display_type == "multi-size-masonry") {
$portfolio_thumb .= '<div class="multi-masonry-img-wrap"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></div>' . "\n";
} else {
$portfolio_thumb .= '<div class="img-wrap"><img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $image_alt . '" /></div>' . "\n";
}
$portfolio_thumb .= '<div class="figcaption-wrap"></div>';
if ($item_subtitle != "" && $hover_show_excerpt == "no" && ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry")) {
$portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
} else {
if ($display_type == "standard" || $display_type == "masonry") {
$portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-alt">';
} else {
if ($hover_show_excerpt == "yes" && ($display_type == "gallery" || $display_type == "masonry-gallery")) {
$portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info thumb-info-excerpt">';
} else {
$portfolio_thumb .= '<figcaption ' . $port_hover_style . '><div class="thumb-info">';
}
}
}
if ($display_type == "gallery" || $display_type == "masonry-gallery" || $display_type == "multi-size-masonry") {
if ($hover_show_excerpt == "yes") {
$portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
if ($post_excerpt != "") {
$portfolio_thumb .= '<div class="name-divide"></div>';
$portfolio_thumb .= '<div itemprop="description" ' . $port_hover_text_style . '>' . $post_excerpt . '</div>';
}
} else {
if (sf_theme_supports('alt-gallery-hover')) {
if ($item_link['svg_icon'] != "") {
$portfolio_thumb .= $item_link['svg_icon'];
} else {
$portfolio_thumb .= '<i class="' . $item_link['icon'] . '"></i>';
}
}
$portfolio_thumb .= '<h4 itemprop="name headline" ' . $port_hover_text_style . '>' . $item_title . '</h4>';
if ($item_subtitle != "") {
$portfolio_thumb .= '<div class="name-divide"></div>';
$portfolio_thumb .= '<h5 itemprop="name alternativeHeadline" ' . $port_hover_text_style . '>' . $item_subtitle . '</h5>';
}
}
} else {
if ($item_link['svg_icon'] != "") {
$portfolio_thumb .= $item_link['svg_icon'];
} else {
$portfolio_thumb .= '<i class="' . $item_link['icon'] . '"></i>';
}
}
$portfolio_thumb .= '</div></figcaption>';
}
}
}
$portfolio_thumb .= '</figure>' . "\n";
return $portfolio_thumb;
}
示例9: sf_mega_menu_add_custom_fields
/**
* Add custom fields to edit menu page
*
* @access public
* @since 1.0
* @return void
*/
function sf_mega_menu_add_custom_fields($item_id, $item, $depth, $args)
{
$built_in_mega = true;
if (sf_theme_supports('max-mega-menu')) {
$built_in_mega = false;
}
$button_colours = array('accent' => __('Accent', 'swiftframework'), 'black' => __('Black', 'swiftframework'), 'white' => __('White', 'swiftframework'), 'blue' => __('Blue', 'swiftframework'), 'grey' => __('Grey', 'swiftframework'), 'lightgrey' => __('Light Grey', 'swiftframework'), 'orange' => __('Orange', 'swiftframework'), 'green' => __('Green', 'swiftframework'), 'pink' => __('Pink', 'swiftframework'), 'gold' => __('Gold', 'swiftframework'), 'purple' => __('Purple', 'swiftframework'), 'midnight' => __('Midnight', 'swiftframework'), 'transparent-light' => __('Transparent - Light', 'swiftframework'), 'transparent-dark' => __('Transparent - Dark', 'swiftframework'));
$button_types = array("standard" => __("Standard", "swiftframework"), "bordered" => __("Bordered", "swiftframework"), "rounded" => __("Rounded", "swiftframework"), "rounded-bordered" => __("Rounded Bordered", "swiftframework"));
$button_colours = apply_filters('sf_menu_button_colours', $button_colours);
$button_types = apply_filters('sf_menu_button_types', $button_types);
?>
<div class="sf-menu-options">
<?php
if ($depth == 0) {
?>
<h4>Mega Menu Options</h4>
<?php
if ($built_in_mega) {
?>
<p class="field-custom description description-wide">
<label
for="edit-menu-megamenu-<?php
echo esc_attr($item_id);
?>
"><?php
_e('Enable Mega Menu', 'swiftframework');
?>
<input type="checkbox" id="edit-menu-megamenu-<?php
echo esc_attr($item_id);
?>
"
class="edit-menu-item-custom" id="menu-megamenu[<?php
echo esc_attr($item_id);
?>
]"
name="menu-megamenu[<?php
echo esc_attr($item_id);
?>
]"
value="1" <?php
echo checked(!empty($item->megamenu), 1, false);
?>
/>
</label>
</p>
<p class="field-custom description description-wide">
<label
for="edit-menu-megamenucols-<?php
echo esc_attr($item_id);
?>
"><?php
_e('Mega Menu Columns', 'swiftframework');
?>
</label>
<select class="fat" id="edit-menu-megamenucols-<?php
echo esc_attr($item_id);
?>
"
name="menu-megamenucols[<?php
echo esc_attr($item_id);
?>
]">
<?php
for ($i = 1; $i <= 6; $i++) {
if ($i == $item->megamenucols) {
echo '<option selected="selected">' . $i . '</option>';
} else {
echo '<option>' . $i . '</option>';
}
}
?>
</select>
</p>
<p class="field-custom description description-wide">
<label
for="edit-menu-is-naturalwidth-<?php
echo esc_attr($item_id);
?>
"><?php
_e('Natural Width Mega Menu', 'swiftframework');
?>
<input type="checkbox" id="edit-menu-is-naturalwidth-<?php
echo esc_attr($item_id);
?>
"
class="edit-menu-item-custom" id="menu-is-naturalwidth[<?php
echo esc_attr($item_id);
?>
]"
//.........这里部分代码省略.........
示例10: content
protected function content($atts, $content = null)
{
global $sf_options;
$title = $category = $wrap_class = $title_class = $item_class = $width = $el_class = $output = $filter = $items = $el_position = '';
extract(shortcode_atts(array('title' => '', "item_count" => '5', "category" => 'all', 'pagination' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
$pagination_view_icon = apply_filters('sf_pagination_view_icon', '<i class="sf-icon-quickview"></i>');
// TYPE CHECK
$alt_display = false;
if (sf_theme_supports('spb-port-showcase-alt')) {
$alt_display = true;
}
// CATEGORY SLUG MODIFICATION
if ($category == "All") {
$category = "all";
}
if ($category == "all") {
$category = '';
}
$category_slug = str_replace('_', '-', $category);
global $post, $wp_query;
$categories = explode(",", $category_slug);
$translated_categories = '';
foreach ($categories as $key => $category_slug) {
$category_id_by_slug = get_term_by('slug', $category_slug, 'portfolio-category');
if (isset($category_id_by_slug->term_id)) {
$translated_slug_id = apply_filters('wpml_object_id', $category_id_by_slug->term_id, 'custom taxonomy', true);
$translated_slug = get_term_by('id', $translated_slug_id, 'portfolio-category');
$translated_categories = $translated_categories . ($key < count($categories) - 1 ? $translated_slug->slug . ',' : $translated_slug->slug);
}
}
$portfolio_args = array('post_type' => 'portfolio', 'post_status' => 'publish', 'portfolio-category' => $translated_categories, 'posts_per_page' => $item_count, 'no_found_rows' => 1);
$portfolio_items = new WP_Query($portfolio_args);
// OUTPUT
if ($alt_display == "yes") {
if ($pagination == "yes") {
$wrap_class = "has-pagination ";
}
$title_class = "center-title";
global $sf_carouselID;
if ($sf_carouselID == "") {
$sf_carouselID = 1;
} else {
$sf_carouselID++;
}
$items .= '<div class="port-carousel carousel-wrap">';
$items .= spb_carousel_arrows(true);
$items .= '<div id="carousel-' . $sf_carouselID . '" class="portfolio-showcase carousel-items staged-carousel gutters clearfix" data-columns="5" data-auto="false" data-pagination="' . $pagination . '">';
} else {
$items .= '<div class="portfolio-showcase-wrap"><ul class="portfolio-showcase-items clearfix" data-columns="' . $item_count . '">';
}
while ($portfolio_items->have_posts()) {
$portfolio_items->the_post();
if ($alt_display) {
$items .= '<div itemscope class="clearfix carousel-item portfolio-item gallery-item">';
$items .= sf_portfolio_thumbnail("gallery", "", "1/1", '3', "no", 0, "yes", "yes");
$items .= '</div>';
} else {
$thumb_img_url = "";
$item_title = get_the_title();
$item_subtitle = sf_get_post_meta($post->ID, 'sf_portfolio_subtitle', true);
$thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
foreach ($thumb_image as $detail_image) {
$thumb_img_url = $detail_image['url'];
break;
}
if (!$thumb_image || $thumb_img_url == "") {
$thumb_image = get_post_thumbnail_id();
$thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
}
$item_title = get_the_title();
$permalink = get_permalink();
$item_link = sf_portfolio_item_link();
$items .= '<li itemscope class="clearfix portfolio-item deselected-item ' . $item_class . '">';
// THUMBNAIL MEDIA TYPE SETUP
$image_width = 700;
$image_height = 350;
if ($item_count == "5") {
$image_width = 500;
$image_height = 500;
}
if ($thumb_img_url == "") {
$thumb_img_url = "default";
}
$image = sf_aq_resize($thumb_img_url, $image_width, $image_height, true, false);
if ($image) {
$items .= '<a ' . $item_link['config'] . '>';
$items .= '<img itemprop="image" class="main-image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
$items .= '</a>';
}
if ($item_subtitle == "") {
$items .= '<div class="item-info">';
$items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
$items .= '</div>';
} else {
$items .= '<div class="item-info has-subtitle">';
$items .= '<span class="item-title"><a href="' . $permalink . '">' . $item_title . '</a></span>';
$items .= '<span><a href="' . $permalink . '">' . $item_subtitle . '</a></span>';
$items .= '</div>';
}
$items .= '</li>';
//.........这里部分代码省略.........
示例11: sf_mobile_shop_filters
function sf_mobile_shop_filters()
{
if (!sf_theme_supports('mobile-shop-filters')) {
return;
}
?>
<div class="sf-mobile-shop-filters row">
<?php
if (function_exists('dynamic_sidebar') && sf_is_sidebar_active('mobile-woocommerce-filters')) {
?>
<?php
dynamic_sidebar('mobile-woocommerce-filters');
?>
<?php
} else {
?>
<h5 class="no-widgets container"><?php
_e("Please add widgets to the WooCommerce Filters widget area in Appearance > Widgets", "swiftframework");
?>
</h5>
<?php
}
?>
</div>
<?php
}
示例12: spb_register_css
public function spb_register_css()
{
wp_register_style('bootstrap', $this->assetURL('css/bootstrap.css'), false, SPB_VERSION, false);
wp_register_style('page-builder', $this->assetURL('css/page-builder.css'), false, null, false);
wp_register_style('colorpicker', $this->assetURL('css/jquery.minicolors.css'), false, null, false);
wp_register_style('uislider', $this->assetURL('css/jquery.nouislider.min.css'), false, null, false);
wp_register_style('chosen', $this->assetURL('css/chosen.min.css'), false, null, false);
wp_register_style('ilightbox', $this->assetURL('css/ilightbox.css'), false, null, false);
wp_register_style('ilightbox-dark', $this->assetURL('css/ilightbox-dark-skin/skin.css'), false, null, false);
if (sf_theme_supports('icon-mind-font')) {
wp_register_style('ss-iconmind', get_template_directory_uri() . '/css/iconmind.css', array(), null, 'all');
}
if (sf_theme_supports('gizmo-icon-font')) {
wp_register_style('ss-gizmo', get_template_directory_uri() . '/css/ss-gizmo.css', array(), null, 'all');
}
wp_register_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), null, 'all');
}
示例13: spb_register_css
public function spb_register_css()
{
wp_register_style('swift-pb-font', $this->assetURL('css/swift-pb.css'), false, null, false);
wp_register_style('materialize-components-css', $this->assetURL('materialize/css/materialize.css'), false, null, false);
wp_register_style('spb-bootstrap', $this->assetURL('css/bootstrap.css'), false, SPB_VERSION, false);
wp_register_style('page-builder', $this->assetURL('css/page-builder.css'), false, null, false);
wp_register_style('page-builder-min', $this->assetURL('css/page-builder.min.css'), false, null, false);
wp_register_style('colorpicker', $this->assetURL('css/jquery.minicolors.css'), false, null, false);
wp_register_style('uislider', $this->assetURL('css/jquery.nouislider.min.css'), false, null, false);
wp_register_style('chosen', $this->assetURL('css/chosen.min.css'), false, null, false);
wp_register_style('ilightbox', $this->assetURL('css/ilightbox.css'), false, null, false);
wp_register_style('ilightbox-dark', $this->assetURL('css/ilightbox-dark-skin/skin.css'), false, null, false);
if (sf_theme_supports('icon-mind-font')) {
wp_register_style('ss-iconmind', get_template_directory_uri() . '/css/iconmind.css', array(), null, 'all');
}
if (sf_theme_supports('gizmo-icon-font')) {
wp_register_style('ss-gizmo', get_template_directory_uri() . '/css/ss-gizmo.css', array(), null, 'all');
}
if (sf_theme_supports('nucleo-general-font')) {
wp_register_style('nucleo', get_template_directory_uri() . '/css/iconfont.css', array(), null, 'all');
}
wp_register_style('fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), null, 'all');
wp_register_style('materialicons', 'https://fonts.googleapis.com/icon?family=Material+Icons', array(), null, 'all');
}
示例14: register_nav_menus
<?php
/*
*
* Swift Framework Menu Functions
* ------------------------------------------------
* Swift Framework v3.0
* Copyright Swift Ideas 2015 - http://www.swiftideas.com
*
* sf_setup_menus()
*
*/
/* CUSTOM MENU SETUP
================================================== */
register_nav_menus(array('main_navigation' => __('Main Menu', "swiftframework"), 'overlay_menu' => __('Overlay Menu', "swiftframework"), 'mobile_menu' => __('Mobile Menu', "swiftframework"), 'top_bar_menu' => __('Top Bar Menu', "swiftframework"), 'footer_menu' => __('Footer Menu', "swiftframework")));
/* SLIDEOUT MENU SETUP
================================================== */
if (sf_theme_supports('slideout-menu')) {
register_nav_menus(array('slideout_menu' => __('Slideout Menu', "swiftframework")));
}
示例15: start_el
function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0)
{
global $wp_query;
$indent = $depth ? str_repeat("\t", $depth) : '';
$class_names = $value = $natural_width = $mega_menu_cols = '';
$classes = empty($item->classes) ? array() : (array) $item->classes;
$megamenu = empty($item->megamenu) ? "sf-std-menu" : "sf-mega-menu";
if (!empty($item->megamenu)) {
$natural_width = empty($item->isnaturalwidth) ? "sf-mega-menu-fw" : "sf-mega-menu-natural-width";
}
$alt_style = empty($item->altstyle) ? "" : "sf-mega-menu-alt";
$hideheadings = empty($item->hideheadings) ? "" : "no-headings";
$nocolumnspacing = empty($item->nocolumnspacing) ? "" : "no-column-spacing";
$menu_width = empty($item->menuwidth) ? "" : 'style="width: ' . $item->menuwidth . 'px;"';
$loggedinvis = empty($item->loggedinvis) ? "" : "sf-menu-item-loggedin";
$loggedoutvis = empty($item->loggedoutvis) ? "" : "sf-menu-item-loggedout";
$newbadge = empty($item->newbadge) ? "" : "sf-menu-item-new-badge";
$menuitembtn = empty($item->menuitembtn) ? "" : "sf-menu-item-btn";
$buttontype = empty($item->buttontype) ? "" : $item->buttontype;
$buttoncolour = empty($item->buttoncolour) ? "" : $item->buttoncolour;
$hashtmlcontent = empty($item->htmlcontent) ? "" : "sf-menu-item-html";
$class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));
$class_names = ' class="menu-item-' . $item->ID . ' ' . esc_attr($class_names) . ' ' . $megamenu . ' ' . $natural_width . ' ' . $alt_style . ' ' . $hideheadings . ' ' . $nocolumnspacing . ' ' . $loggedinvis . ' ' . $loggedoutvis . ' ' . $menuitembtn . ' ' . $newbadge . ' ' . $hashtmlcontent . '" ' . $menu_width;
if (!empty($item->megamenu) && !empty($item->megamenucols)) {
$mega_menu_cols = 'data-megamenucols="' . $item->megamenucols . '"';
}
$output .= $indent . '<li ' . $value . $class_names . $mega_menu_cols . '>';
$attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : '';
$attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : '';
$attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : '';
$attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';
if ($menuitembtn != "" && sf_theme_supports('menu-button-advanced')) {
if ($buttontype == "rounded-bordered") {
$buttontype = "rounded bordered";
}
$attributes .= ' class="sf-button ' . $buttoncolour . ' ' . $buttontype . '"';
}
$prepend = '<span class="menu-item-text">';
$append = '</span>';
//$append = '<span class="nav-line"></span>';
$description = !empty($item->description) ? '<span class="menu-item-desc">' . esc_attr($item->description) . '</span>' : '';
if ($depth != 0) {
$append = $prepend = "";
}
if (!empty($item->megatitle)) {
$item_output = $args->before;
$item_output .= '<span class="title">';
if (!empty($item->menuicon)) {
$item_output .= '<i class="' . $item->menuicon . '"></i>';
}
$item_output .= $args->link_before . $prepend . apply_filters('the_title', $item->title, $item->ID) . $append;
//$item_output .= $args->link_after;
$item_output .= $description . $args->link_after;
$item_output .= '</span>';
if (!empty($item->htmlcontent)) {
$item_output .= '<div class="mega-menu-widget">' . do_shortcode($item->htmlcontent) . '</div>';
}
$item_output .= $args->after;
} else {
$item_output = $args->before;
$item_output .= '<a' . $attributes . '>';
$item_output .= $args->link_before . $prepend;
if (!empty($item->menuicon)) {
$item_output .= '<i class="' . $item->menuicon . '"></i>';
}
$item_output .= apply_filters('the_title', $item->title, $item->ID) . $append;
//$item_output .= $args->link_after;
$item_output .= $description . $args->link_after;
//$item_output .= ' '.$item->subtitle.'</a>';
$item_output .= '</a>';
if (!empty($item->htmlcontent)) {
$item_output .= '<div class="mega-menu-widget">' . do_shortcode($item->htmlcontent) . '</div>';
}
$item_output .= $args->after;
}
$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}