本文整理汇总了PHP中wolf_get_theme_option函数的典型用法代码示例。如果您正苦于以下问题:PHP wolf_get_theme_option函数的具体用法?PHP wolf_get_theme_option怎么用?PHP wolf_get_theme_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wolf_get_theme_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wolf_maintenance
/**
* Redirect visitors to a maintenance/coming soon page
*
* @access public
* @return void
*/
function wolf_maintenance()
{
if (!is_user_logged_in() && wolf_get_theme_option('maintenance_page_id') && !is_page(wolf_get_theme_option('maintenance_page_id'))) {
wp_safe_redirect(get_permalink(wolf_get_theme_option('maintenance_page_id')), 302);
exit;
}
}
示例2: wolf_products_per_page
/**
* Set products per page
*
* @access public
* @return int
*/
function wolf_products_per_page()
{
// Display 12 products per page by default
$products_per_page = 12;
if (wolf_get_theme_option('products_per_page')) {
$products_per_page = wolf_get_theme_option('products_per_page');
}
return $products_per_page;
}
示例3: wolf_get_meta_share_img
/**
* Get the share image
*
* @param int $post_id
* @return string $share_image
*/
function wolf_get_meta_share_img($post_id)
{
global $post;
/* We define the default image first and see if the post contains an image after */
$share_image = wolf_get_theme_option('share_img') ? wolf_get_url_from_attachment_id(absint(wolf_get_theme_option('share_img')), 'large') : null;
if (has_post_thumbnail($post_id)) {
$share_image = wolf_get_post_thumbnail_url('large', $post_id);
}
return $share_image;
}
示例4: wolf_video_search_results
/**
* Display only video post type in video search results
*
* @param object $query
* @return object $query
*/
function wolf_video_search_results($query)
{
if (isset($_GET['post-type']) && 'video' == $_GET['post-type'] && class_exists('Wolf_Videos')) {
if ($query->is_search) {
$posts_per_page = wolf_get_theme_option('video_posts_per_page') ? wolf_get_theme_option('video_posts_per_page') : 12;
$query->set('post_type', 'video');
$query->set('posts_per_page', $posts_per_page);
}
}
return $query;
}
示例5: wolf_enqueue_style
/**
* Enqueue CSS stylsheets
* JS scripts are separated and can be found in includes/scripts.php
*/
function wolf_enqueue_style()
{
global $wp_styles;
$theme_slug = wolf_get_theme_slug();
wp_dequeue_style('flexslider');
wp_deregister_style('flexslider');
wp_dequeue_style('swipebox');
wp_deregister_style('swipebox');
wp_dequeue_style('fancybox');
wp_deregister_style('fancybox');
$lightbox = wolf_get_theme_option('lightbox', 'swipebox');
if ('swipebox' == $lightbox) {
wp_enqueue_style('swipebox', WOLF_THEME_URI . '/css/lib/swipebox.min.css', array(), '1.3.0');
} elseif ('fancybox' == $lightbox) {
wp_enqueue_style('fancybox', WOLF_THEME_URI . '/css/lib/fancybox.css', array(), '2.1.4');
}
// WP icons
wp_enqueue_style('dashicons');
// Enqueue scripts conditionaly for the blog
if (wolf_get_theme_option('blog_infinite_scroll') && 'post' == get_post_type() && !is_single()) {
// WP mediaelement
wp_enqueue_style('wp-mediaelement');
}
if (wolf_get_theme_option('css_min')) {
wp_enqueue_style(wolf_get_theme_slug() . '-style-min', WOLF_THEME_URI . '/css/main.min.css', array(), WOLF_THEME_VERSION);
} else {
// normalize
wp_enqueue_style('normalize', WOLF_THEME_URI . '/css/lib/normalize.css', array(), '3.0.0');
// Bagpakk
wp_enqueue_style('bagpakk', WOLF_THEME_URI . '/css/lib/bagpakk-wordpress-custom.min.css', array(), '1.0.0');
// Flexslider
wp_enqueue_style('flexslider', WOLF_THEME_URI . '/css/lib/flexslider.css', array(), '2.2.0');
// Owl Carousel
wp_enqueue_style('owlcarousel', WOLF_THEME_URI . '/css/lib/owl.carousel.min.css', array(), '2.0.0');
// Font Awesome
wp_enqueue_style('icon-pack', WOLF_THEME_URI . '/css/icon-pack.min.css', array(), WOLF_THEME_VERSION);
// Main stylsheet
wp_enqueue_style($theme_slug . '-style', WOLF_THEME_URI . '/css/main.css', array(), WOLF_THEME_VERSION);
}
// WP default Stylesheet
wp_enqueue_style($theme_slug . '-default', get_stylesheet_uri(), array(), WOLF_THEME_VERSION);
// Loads the Internet Explorer 8 specific stylesheet. */
wp_enqueue_style($theme_slug . '-ie8-style', WOLF_THEME_URI . '/css/ie8.css');
$wp_styles->add_data($theme_slug . '-ie8-style', 'conditional', 'lte IE 8');
}
示例6: wolf_shortcode_last_videos_carousel
/**
* countdown shortcode
*
* @param array $atts
* @return string
*/
function wolf_shortcode_last_videos_carousel($atts)
{
if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
$atts = vc_map_get_attributes('wolf_last_videos_carousel', $atts);
}
extract(shortcode_atts(array('count' => 3, 'category' => '', 'inline_style' => '', 'class' => ''), $atts));
$count = absint($count);
$category = sanitize_text_field($category);
$class = sanitize_text_field($class);
$inline_style = sanitize_text_field($inline_style);
$args = array('post_type' => 'video', 'posts_per_page' => absint($count));
if (wolf_get_theme_option('video_reorder')) {
$args['order'] = 'ASC';
$args['meta_key'] = '_position';
$args['orderby'] = 'meta_value_num';
}
if ($category) {
$args['video_type'] = $category;
}
$loop = new WP_Query($args);
$style = '';
$class = $class ? "{$class} " : '';
// add space
$class .= "videos-carousel";
if ($inline_style) {
$style .= $inline_style;
}
$style = $style ? " style='{$style}'" : '';
$output = "<section class='{$class}'{$style}>";
if ($loop->have_posts()) {
while ($loop->have_posts()) {
$loop->the_post();
$video_url = wolf_get_first_video_url();
$thumbnail = wolf_get_post_thumbnail_url('classic-video-thumb');
if ($video_url) {
$output .= "<div class='item-video' data-merge='2' style='background-image:url({$thumbnail});'><a class='owl-video' href='{$video_url}'></a></div>";
}
}
}
$output .= '</section>';
wp_reset_postdata();
return $output;
}
示例7: wolf_mailchimp
/**
* Return a mailchimp Subscription form
*
* @param string $list
* @param string $size
* @param string $label
* @param string $submit
* @return string $output
*/
function wolf_mailchimp($list, $size = 'normal', $label = '', $submit = 'Subscribe', $button_style = '', $alignment = 'center', $animation = '', $animation_delay = '', $inline_style = '', $class = '')
{
$class = $class ? "{$class} " : '';
// add space
$class .= "wolf-mailchimp-form {$size} wolf-mailchimp-align-{$alignment}";
$style = '';
if ($animation) {
$class .= " wow {$animation}";
}
if ($animation_delay && 'none' != $animation) {
$style .= 'animation-delay:' . absint($animation_delay) / 1000 . 's;-webkit-animation-delay:' . absint($animation_delay) / 1000 . 's;';
}
if ($inline_style) {
$style .= $inline_style;
}
$style = $style ? " style='{$style}'" : '';
$output = "<form class='{$class}'{$style}><input type='hidden' name='wolf-mailchimp-list' class='wolf-mailchimp-list' value='{$list}'>";
if ($label) {
$output .= "<h3 class='widget-title'>{$label}</h3>";
}
$output .= '<div class="wolf-mailchimp-email-container"><input placeholder="' . __('your email', 'wolf') . '" type="text" name="wolf-mailchimp-email" class="wolf-mailchimp-email"></div>';
$output .= "<div class='wolf-mailchimp-submit-container'><input type='submit' name='wolf-mailchimp-submit' class='wolf-mailchimp-submit {$button_style}' value='{$submit}'></div>";
$output .= '<span class="wolf-mailchimp-result"> </span>';
$output .= '</form>';
if (wolf_get_theme_option('mailchimp_api_key') && !empty($list)) {
return $output;
} elseif (is_user_logged_in()) {
$output = '<p class="text-center">';
if (!wolf_get_theme_option('mailchimp_api_key')) {
$output .= __('You must set your mailchimp API key in the theme options', 'wolf') . '<br>';
}
if (!$list) {
$output .= __('You must set a list ID!', 'wolf');
}
$output .= '</p>';
return $output;
}
}
示例8: wolf_logo
*/
?>
<aside id="navbar-container-left">
<div id="navbar-left-inner">
<header>
<?php
echo wolf_logo();
?>
</header>
<p class="site-tagline"><?php
echo get_bloginfo('description');
?>
</p>
<nav class="site-navigation-primary">
<?php
/**
* Main Navigation
*/
wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu dropdown', 'fallback_cb' => ''));
?>
</nav>
<footer>
<?php
$services = wolf_get_theme_option('menu_socials_services');
if ($services) {
echo wolf_theme_socials($services, '1x');
}
?>
</footer>
</div>
</aside><!-- #navbar-container-left -->
示例9: wolf_is_video_search
/**
* Check if we're on a video search results page
*
* @access public
* @return bool
*/
function wolf_is_video_search()
{
$video_search = 'grid' != wolf_get_theme_option('video_type') && is_search() && isset($_GET['post-type']) && 'video' == $_GET['post-type'] && function_exists('wolf_videos_get_template_part');
return $video_search;
}
示例10: wolf_last_post_types_custom_shortcode
/**
* Last works_custom shortcode
*
* @param array $atts
* @param string $content
* @param string $post_type
* @return string
*/
function wolf_last_post_types_custom_shortcode($atts, $content = null, $post_type)
{
if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
//$atts = vc_map_get_attributes( 'wolf_last_photos_widget', $atts );
}
extract(shortcode_atts(array('count' => 4, 'category' => null, 'col' => '4', 'layout' => 'classic', 'padding' => 'no', 'carousel' => '', 'label' => null, 'band' => null, 'animation' => null), $atts));
$layout = wolf_get_image_size($layout);
$post_type = str_replace('wolf_last_posts_', '', $post_type);
$col = absint($col);
$class = "shortcode-{$post_type}-grid shortcode-items-grid {$post_type}-grid-col-{$col} {$post_type}-{$layout}";
if ($animation) {
$class .= " wow {$animation}";
}
if ('modern' == $layout) {
$carousel = false;
}
if ('yes' == $carousel && 'work' == $post_type) {
$class .= " works-carousel";
}
if ('yes' == $carousel && 'release' == $post_type) {
$class .= " releases-carousel";
}
if ('no' == $padding) {
$class .= " {$post_type}-no-padding";
}
if ('release' == $post_type) {
$layout = 'grid';
$carousel = false;
}
ob_start();
$args = array('post_type' => $post_type, 'posts_per_page' => absint($count), 'meta_query' => array(array('key' => '_thumbnail_id', 'compare' => '!=', 'value' => 'NULL')));
if (wolf_get_theme_option($post_type . '_reorder')) {
$args['order'] = 'DESC';
$args['meta_key'] = '_position';
$args['orderby'] = 'meta_value_num';
}
if ('release' == $post_type) {
if ($label) {
$args['label'] = $label;
}
if ($band) {
$args['band'] = $band;
}
}
if ($category) {
$args[$post_type . '_type'] = $category;
}
$loop = new WP_Query($args);
if ($loop->have_posts()) {
?>
<div class="<?php
echo esc_attr($class);
?>
">
<?php
while ($loop->have_posts()) {
$loop->the_post();
if ('work' == $post_type) {
wolf_portfolio_get_template_part('content', 'work-' . $layout);
} elseif ('release' == $post_type) {
get_template_part('wolf-discography/content', 'release-shortcode');
} elseif ('video' == $post_type) {
get_template_part('wolf-videos/content', 'video-shortcode');
} else {
get_template_part('wolf-' . $post_type . '/content', $post_type);
}
}
?>
</div><!-- .shortcode-works-grid -->
<?php
} else {
// no work
?>
<p class="text-center"><?php
__('No post found', 'wolf');
?>
</p>
<?php
}
wp_reset_postdata();
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例11: _e
?>
</div>
<span class="video-read-less"><?php
_e('less', 'wolf');
?>
</span>
</div>
<?php
} else {
?>
<div class="video-excerpt">
<div class="entry-meta">
<?php
echo get_the_term_list($post_id, 'video_type', '<span class="fa fa-folder-o"></span>', __(', ', 'wolf'), '');
?>
<?php
echo get_the_term_list($post_id, 'video_tag', '<br><span class="fa fa-tags"></span>', __(', ', 'wolf'), '');
?>
<div style="height:18px"></div>
</div>
</div>
<?php
}
?>
</div>
<?php
if (wolf_get_theme_option('video_comments')) {
comments_template();
}
?>
</article>
示例12: get_header
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
get_header('discography');
wolf_page_before();
// before page hook
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
$posts_per_page = wolf_get_theme_option('release_posts_per_page') ? wolf_get_theme_option('release_posts_per_page') : -1;
$current_tax = get_query_var('label');
$args = array('post_type' => 'release', 'posts_per_page' => $posts_per_page, 'label' => $current_tax, 'meta_query' => array(array('key' => '_thumbnail_id', 'compare' => '!=', 'value' => 'NULL')));
/*if ( wolf_get_theme_option( 'release_reorder' ) ) {
$args['order'] = 'ASC';
$args['meta_key'] = '_position';
$args['orderby'] = 'meta_value_num';
}*/
if (-1 != $posts_per_page) {
$args['paged'] = $paged;
}
/* Release Post Loop */
$loop = new WP_Query($args);
if ($loop->have_posts()) {
?>
示例13: wolf_output_title
/**
* Display Page Title
*/
function wolf_output_title()
{
$post_id = wolf_get_header_post_id();
$hide_title_area = 'none' == wolf_get_theme_option('page_header_type');
if (get_post_meta($post_id, '_page_header_type', true)) {
$hide_title_area = 'none' == get_post_meta($post_id, '_page_header_type', true);
}
if ($post_id && wolf_get_page_title() && !$hide_title_area && !is_front_page() && !is_page_template('page-templates/home.php')) {
$type = get_post_meta($post_id, '_header_bg_type', true) ? get_post_meta($post_id, '_header_bg_type', true) : 'image';
$video_mp4 = get_post_meta($post_id, '_header_video_bg_mp4', true);
$video_webm = get_post_meta($post_id, '_header_video_bg_webm', true);
$video_ogv = get_post_meta($post_id, '_header_video_bg_ogv', true);
$video_img = get_post_meta($post_id, '_header_video_bg_img', true);
$video_opacity = absint(get_post_meta($post_id, '_header_video_bg_opacity', true)) / 100;
$video_bg_type = get_post_meta($post_id, '_header_video_bg_type', true) ? get_post_meta($post_id, '_header_video_bg_type', true) : 'selfhosted';
$video_youtube_url = get_post_meta($post_id, '_header_video_bg_youtube_url', true);
$image_id = get_post_meta($post_id, '_header_bg_img', true);
$header_effect = get_post_meta($post_id, '_header_bg_effect', true);
$do_parallax = 'parallax' == $header_effect;
$full_screen = 'full' == get_post_meta($post_id, '_page_header_type', true);
if (wolf_get_category_meta('header_bg_img') && 'image' == wolf_get_category_meta('header_bg_type')) {
$type = 'image';
$image_id = wolf_get_category_meta('header_bg_img');
$header_effect = wolf_get_category_meta('header_bg_effect');
$do_parallax = 'parallax' == $header_effect;
$full_screen = 'full' == wolf_get_category_meta('page_header_type');
}
if ('video' == wolf_get_category_meta('header_bg_type')) {
$type = 'video';
$video_mp4 = wolf_get_category_meta('header_video_bg_mp4');
$video_webm = wolf_get_category_meta('header_video_bg_webm');
$video_ogv = wolf_get_category_meta('header_video_bg_ogv');
$video_opacity = absint(wolf_get_category_meta('header_video_bg_opacity')) / 100;
$video_img = wolf_get_category_meta('header_video_bg_img');
$video_bg_type = wolf_get_category_meta('header_video_bg_type');
$video_youtube_url = wolf_get_category_meta('header_video_bg_youtube_url');
}
$class = 'page-header-container';
$_image = esc_url(wolf_get_url_from_attachment_id($image_id, 'extra-large'));
if ($do_parallax && $image_id) {
$class .= ' section-parallax';
}
if ($full_screen) {
$class .= ' full-height';
}
echo '<section class="' . esc_attr($class) . '">';
if ('video' == $type && !is_search()) {
?>
<div class="video-container">
<?php
if ($video_mp4 && 'selfhosted' == $video_bg_type) {
echo wolf_video_bg($video_mp4, $video_webm, $video_ogv, $video_img);
} elseif ($video_youtube_url && 'youtube' == $video_bg_type) {
// debug( $video_img );
echo wolf_youtube_video_bg($video_youtube_url, $video_img);
}
?>
</div>
<?php
}
if ('zoomin' == $header_effect && $image_id && 'image' == $type && !is_search()) {
echo '<div class="bg"><img src="' . $_image . '"></div>';
}
$page_header_type = wolf_get_theme_option('page_header_type');
if (get_post_meta($post_id, '_page_header_type', true)) {
$page_header_type = get_post_meta($post_id, '_page_header_type', true);
$page_header_type = 'full' == $page_header_type ? 'big' : $page_header_type;
}
if (wolf_get_category_meta('page_header_type')) {
$page_header_type = wolf_get_category_meta('page_header_type');
}
echo '<div class="page-header text-center">';
if ('small' == $page_header_type) {
if (!get_post_meta($post_id, '_header_hide_title', true)) {
echo '<div class="wrap intro">';
echo '<div class="breadcrumb">';
echo wolf_breadcrumb();
echo '</div>';
echo '<div class="page-title-container">';
echo wolf_get_page_title();
echo '</div>';
echo '</div>';
}
} else {
if (!get_post_meta($post_id, '_header_hide_title', true)) {
echo '<div class="page-title-container intro">';
echo wolf_get_page_title();
if (is_singular('post')) {
echo '<div class="entry-meta">';
wolf_post_entry_meta();
echo '</div>';
}
echo '</div>';
}
}
echo '</div><!--.page-header --></section>';
}
//.........这里部分代码省略.........
示例14: wolf_albums_get_template_part
<?php
/**
* The galleries loop
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
wolf_albums_get_template_part('content', 'gallery-' . wolf_get_theme_option('gallery_type'));
示例15: wolf_theme_socials
/**
* Output social icons
*
* @access public
* @param string $services
* @param string $size
* @param string $type
* @param string $target
* @param string $custom_style
* @param string $hover_effect
* @param string $margin
* @param string $bg_color
* @param string $icon_color
* @param string $border_color
* @param string $bg_color_hover
* @param string $icon_color_hover
* @param string $border_color_hover
* @param string $alignment
* @return string $output
*/
function wolf_theme_socials($services = '', $size = '2x', $type = 'normal', $target = '_blank', $custom_style = 'no', $hover_effect = 'none', $margin = '', $bg_color = '', $icon_color = '', $border_color = '', $bg_color_hover = '', $icon_color_hover = '', $border_color_hover = '', $alignment = 'center', $animation = '', $animation_delay = '', $inline_style = '', $class = '')
{
global $theme_socials, $ti_icons;
if (!$services) {
$services = $theme_socials;
} else {
$services = strtolower(preg_replace('/\\s+/', '', $services));
$services = explode(',', $services);
}
$style = '';
$icon_style = '';
$class = $class ? "{$class} " : '';
// add space
$class .= "theme-socials-container text-{$alignment}";
if ($animation) {
$class .= " wow {$animation}";
}
if ($animation_delay && 'none' != $animation) {
$style .= 'animation-delay:' . absint($animation_delay) / 1000 . 's;-webkit-animation-delay:' . absint($animation_delay) / 1000 . 's;';
}
if ($inline_style) {
$style .= $inline_style;
}
$style = $style ? " style='{$style}'" : '';
$output = "<div class='{$class}'{$style}>";
// container open tag
$icon_class = "{$type} wolf-social-{$size} hover-{$hover_effect}";
$icon_class .= 'yes' == $custom_style ? ' wolf-social-custom-style' : ' wolf-social-no-custom-style';
$data = '';
if ('yes' == $custom_style) {
if ($bg_color) {
$icon_style .= "background-color:{$bg_color};";
}
if ($icon_color) {
$icon_style .= "color:{$icon_color};";
}
if ($border_color) {
$icon_style .= "border-color:{$border_color};";
}
if ($margin) {
$icon_style .= "margin:{$margin};";
}
// hover style
if ($bg_color_hover) {
$data .= " data-hover-bg-color='{$bg_color_hover}'";
}
if ($icon_color_hover) {
$data .= " data-hover-font-color='{$icon_color_hover}'";
}
if ($border_color_hover) {
$data .= " data-hover-border-color='{$border_color_hover}'";
}
}
$icon_style = $icon_style ? "style='{$icon_style}'" : '';
$prefix = '';
foreach ($services as $s) {
$social = wolf_get_theme_option($s);
if ($social) {
$prefix = in_array('ti-' . $s, array_keys($ti_icons)) ? 'ti' : 'fa fa';
$title = str_replace('-', ' ', $s);
$output .= "<a href='{$social}' title='{$title}' target='{$target}' class='wolf-social-link'>";
$output .= "<span {$icon_style} {$data} class='wolf-social {$prefix}-{$s} {$icon_class}'></span>";
$output .= '</a>';
}
}
$output .= '</div><!-- .theme-socials-container -->';
return $output;
}