当前位置: 首页>>代码示例>>PHP>>正文


PHP get_nectar_theme_options函数代码示例

本文整理汇总了PHP中get_nectar_theme_options函数的典型用法代码示例。如果您正苦于以下问题:PHP get_nectar_theme_options函数的具体用法?PHP get_nectar_theme_options怎么用?PHP get_nectar_theme_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_nectar_theme_options函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_love

 function add_love()
 {
     global $post;
     $output = $this->love_post($post->ID);
     $class = 'nectar-love';
     $title = __('Love this', NECTAR_THEME_NAME);
     if (isset($_COOKIE['nectar_love_' . $post->ID])) {
         $class = 'nectar-love loved';
         $title = __('You already love this!', NECTAR_THEME_NAME);
     }
     $options = get_nectar_theme_options();
     $post_header_style = !empty($options['blog_header_type']) ? $options['blog_header_type'] : 'default';
     $masonry_type = !empty($options['blog_masonry_type']) ? $options['blog_masonry_type'] : 'classic';
     $heart_icon = !empty($options['theme-skin']) && $options['theme-skin'] == 'ascend' ? '<div class="heart-wrap"><i class="icon-salient-heart-2"></i> <i class="icon-salient-heart loved"></i></div>' : '<i class="icon-salient-heart"></i>';
     if (!empty($options['theme-skin']) && $options['theme-skin'] == 'ascend' && isset($_COOKIE['nectar_love_' . $post->ID]) && $masonry_type != 'classic_enhanced') {
         $heart_icon = '<i class="icon-salient-heart"></i>';
     }
     if (isset($_COOKIE['nectar_love_' . $post->ID]) && $masonry_type == 'classic_enhanced') {
         $heart_icon = '<i class="icon-salient-heart-2 loved"></i>';
     }
     if ($post->post_type == 'post' && is_single() && $post_header_style == 'default_minimal') {
         return '<a href="#" class="' . $class . '" id="nectar-love-' . $post->ID . '" title="' . $title . '"> ' . $heart_icon . __('Love', NECTAR_THEME_NAME) . '<span class="total_loves">' . $output . '</span></a>';
     } else {
         return '<a href="#" class="' . $class . '" id="nectar-love-' . $post->ID . '" title="' . $title . '"> ' . $heart_icon . $output . '</a>';
     }
 }
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:26,代码来源:nectar-love.php

示例2: nectar_metabox_page

function nectar_metabox_page()
{
    $options = get_nectar_theme_options();
    if (!empty($options['transparent-header']) && $options['transparent-header'] == '1') {
        $disable_transparent_header = array('name' => __('Disable Transparency From Navigation', NECTAR_THEME_NAME), 'desc' => __('You can use this option to force your navigation header to stay a solid color even if it qualifies to trigger the <a target="_blank" href="' . admin_url('?page=redux_options&tab=4#header-padding') . '"> transparent effect</a> you have activated in the Salient options panel.', NECTAR_THEME_NAME), 'id' => '_disable_transparent_header', 'type' => 'checkbox', 'std' => '');
        $force_transparent_header = array('name' => __('Force Transparency On Navigation', NECTAR_THEME_NAME), 'desc' => __('You can use this option to force your navigation header to start transparent even if it does not qualify to trigger the <a target="_blank" href="' . admin_url('?page=redux_options&tab=4#header-padding') . '"> transparent effect</a> you have activated in the Salient options panel.', NECTAR_THEME_NAME), 'id' => '_force_transparent_header', 'type' => 'checkbox', 'std' => '');
    } else {
        $disable_transparent_header = null;
        $force_transparent_header = null;
    }
    #-----------------------------------------------------------------#
    # Header Settings
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-page-header', 'title' => __('Page Header Settings', NECTAR_THEME_NAME), 'description' => __('Here you can configure how your page header will appear. <br/> For a full width background image behind your header text, simply upload the image below. To have a standard header just fill out the fields below and don\'t upload an image.', NECTAR_THEME_NAME), 'post_type' => 'page', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Background Type', NECTAR_THEME_NAME), 'desc' => __('Please select the background type you would like to use for your slide.', NECTAR_THEME_NAME), 'id' => '_nectar_slider_bg_type', 'type' => 'choice_below', 'options' => array('image_bg' => 'Image Background', 'video_bg' => 'Video Background', 'particle_bg' => 'HTML5 Canvas Background'), 'std' => 'image_bg'), array('name' => __('Particle Images', NECTAR_THEME_NAME), 'desc' => 'Add images here that will be used to create the particle shapes.', 'id' => '_nectar_canvas_shapes', 'type' => 'canvas_shape_group', 'class' => 'nectar_slider_canvas_shape', 'std' => ''), array('name' => __('Video WebM Upload', NECTAR_THEME_NAME), 'desc' => __('Browse for your WebM video file here.<br/> This will be automatically played on load so make sure to use this responsibly for enhancing your design, rather than annoy your user. e.g. A video loop with no sound.<br/><strong>You must include this format & the mp4 format to render your video with cross browser compatibility. OGV is optional.</strong> <br/><strong>Video must be in a 16:9 aspect ratio.</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_media_upload_webm', 'type' => 'media', 'std' => ''), array('name' => __('Video MP4 Upload', NECTAR_THEME_NAME), 'desc' => __('Browse for your mp4 video file here.<br/> See the note above for recommendations on how to properly use your video background.', NECTAR_THEME_NAME), 'id' => '_nectar_media_upload_mp4', 'type' => 'media', 'std' => ''), array('name' => __('Video OGV Upload', NECTAR_THEME_NAME), 'desc' => __('Browse for your OGV video file here.<br/>  See the note above for recommendations on how to properly use your video background.', NECTAR_THEME_NAME), 'id' => '_nectar_media_upload_ogv', 'type' => 'media', 'std' => ''), array('name' => __('Preview Image', NECTAR_THEME_NAME), 'desc' => __('This is the image that will be seen in place of your video on mobile devices & older browsers before your video is played (browsers like IE8 don\'t allow autoplaying).', NECTAR_THEME_NAME), 'id' => '_nectar_slider_preview_image', 'type' => 'file', 'std' => ''), array('name' => __('Page Header Image', NECTAR_THEME_NAME), 'desc' => __('The image should be between 1600px - 2000px wide and have a minimum height of 475px for best results. Click "Browse" to upload and then "Insert into Post".', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg', 'type' => 'file', 'std' => ''), array('name' => __('Parallax Header', NECTAR_THEME_NAME), 'desc' => __('This will cause your header to have a parallax scroll effect.', NECTAR_THEME_NAME), 'id' => '_nectar_header_parallax', 'type' => 'checkbox', 'extra' => 'first2', 'std' => 1), array('name' => __('Box Roll Header', NECTAR_THEME_NAME), 'desc' => __('This will cause your header to have a 3d box roll on scroll. (deactivated for boxed layouts)', NECTAR_THEME_NAME), 'id' => '_nectar_header_box_roll', 'type' => 'checkbox', 'extra' => 'last', 'std' => ''), array('name' => __('Page Header Height', NECTAR_THEME_NAME), 'desc' => __('How tall do you want your header? <br/>Don\'t include "px" in the string. e.g. 350 <br/><strong>This only applies when you are using an image/bg color.</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg_height', 'type' => 'text', 'std' => ''), array('name' => __('Fullscreen Height', NECTAR_THEME_NAME), 'desc' => __('Chooseing this option will allow your header to always remain fullscreen on all devices/screen sizes.', NECTAR_THEME_NAME), 'id' => '_nectar_header_fullscreen', 'type' => 'checkbox', 'std' => ''), array('name' => __('Page Header Title', NECTAR_THEME_NAME), 'desc' => __('Enter in the page header title', NECTAR_THEME_NAME), 'id' => '_nectar_header_title', 'type' => 'text', 'std' => ''), array('name' => __('Page Header Subtitle', NECTAR_THEME_NAME), 'desc' => __('Enter in the page header subtitle', NECTAR_THEME_NAME), 'id' => '_nectar_header_subtitle', 'type' => 'text', 'std' => ''), array('name' => __('Text Effect', NECTAR_THEME_NAME), 'desc' => __('Please select your desired text effect', NECTAR_THEME_NAME), 'id' => '_nectar_page_header_text-effect', 'type' => 'select', 'std' => 'none', 'options' => array("none" => "None", "rotate_in" => "Rotate In")), array('name' => __('Shape Autorotate Timing', NECTAR_THEME_NAME), 'desc' => __('Enter your desired autorotation time in milliseconds e.g. "5000". Leaving this blank will disable the functionality.', NECTAR_THEME_NAME), 'id' => '_nectar_particle_rotation_timing', 'type' => 'text', 'std' => ''), array('name' => __('Disable Chance For Particle Explosion', NECTAR_THEME_NAME), 'desc' => __('By default there\'s a 50% chance on autorotation that your particles will explode. Checking this box disables that.', NECTAR_THEME_NAME), 'id' => '_nectar_particle_disable_explosion', 'type' => 'checkbox', 'std' => ''), array('name' => __('Content Alignment', NECTAR_THEME_NAME), 'desc' => __('Horizontal Alignment', NECTAR_THEME_NAME), 'id' => '_nectar_page_header_alignment', 'type' => 'caption_pos', 'options' => array('left' => 'Left', 'center' => 'Centered', 'right' => 'Right'), 'std' => 'left', 'extra' => 'first2'), array('name' => __('Content Alignment', NECTAR_THEME_NAME), 'desc' => __('Vertical Alignment', NECTAR_THEME_NAME), 'id' => '_nectar_page_header_alignment_v', 'type' => 'caption_pos', 'options' => array('top' => 'Top', 'middle' => 'Middle', 'bottom' => 'Bottom'), 'std' => 'middle', 'extra' => 'last'), array('name' => __('Background Alignment', NECTAR_THEME_NAME), 'desc' => __('Please choose how you would like your slides background to be aligned', NECTAR_THEME_NAME), 'id' => '_nectar_page_header_bg_alignment', 'type' => 'select', 'std' => 'center', 'options' => array("top" => "Top", "center" => "Center", "bottom" => "Bottom")), array('name' => __('Page Header Background Color', NECTAR_THEME_NAME), 'desc' => __('Set your desired page header background color if not using an image', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg_color', 'type' => 'color', 'std' => ''), array('name' => __('Page Header Font Color', NECTAR_THEME_NAME), 'desc' => __('Set your desired page header font color', NECTAR_THEME_NAME), 'id' => '_nectar_header_font_color', 'type' => 'color', 'std' => ''), $disable_transparent_header, $force_transparent_header));
    $callback = create_function('$post,$meta_box', 'nectar_create_meta_box( $post, $meta_box["args"] );');
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Portfolio Display Settings
    #-----------------------------------------------------------------#
    $portfolio_types = get_terms('project-type');
    $types_options = array("all" => "All");
    foreach ($portfolio_types as $type) {
        $types_options[$type->slug] = $type->name;
    }
    $meta_box = array('id' => 'nectar-metabox-portfolio-display', 'title' => __('Portfolio Display Settings', NECTAR_THEME_NAME), 'description' => __('Here you can configure which categories will display in your portfolio.', NECTAR_THEME_NAME), 'post_type' => 'page', 'context' => 'side', 'priority' => 'core', 'fields' => array(array('name' => 'Portfolio Categories', 'desc' => '', 'id' => 'nectar-metabox-portfolio-display', 'type' => 'multi-select', 'options' => $types_options, 'std' => 'all'), array('name' => 'Display Sortable', 'desc' => 'Should these portfolio items be sortable?', 'id' => 'nectar-metabox-portfolio-display-sortable', 'type' => 'checkbox', 'std' => '1')));
    $callback = create_function('$post,$meta_box', 'nectar_create_meta_box( $post, $meta_box["args"] );');
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
}
开发者ID:The-Keep-Studios,项目名称:tks-website,代码行数:28,代码来源:page-meta.php

示例3: myprefix_autocomplete_suggestions

function myprefix_autocomplete_suggestions()
{
    $search_term = $_REQUEST['term'];
    $search_term = apply_filters('get_search_query', $search_term);
    $options = get_nectar_theme_options();
    $show_postsnum = !empty($options['theme-skin']) && $options['theme-skin'] == 'ascend' ? 3 : 6;
    $search_array = array('s' => $search_term, 'showposts' => $show_postsnum, 'post_type' => 'any', 'post_status' => 'publish', 'post_password' => '', 'suppress_filters' => true);
    $query = http_build_query($search_array);
    $posts = get_posts($query);
    // Initialise suggestions array
    $suggestions = array();
    global $post;
    foreach ($posts as $post) {
        setup_postdata($post);
        // Initialise suggestion array
        $suggestion = array();
        $suggestion['label'] = esc_html($post->post_title);
        $suggestion['link'] = get_permalink();
        $suggestion['image'] = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'thumbnail', array('title' => '')) : '<i class="icon-salient-pencil"></i>';
        if (get_post_type($post->ID) == 'post') {
            $suggestion['post_type'] = __('Blog Post', NECTAR_THEME_NAME);
        } else {
            if (get_post_type($post->ID) == 'page') {
                $suggestion['post_type'] = __('Page', NECTAR_THEME_NAME);
            } else {
                if (get_post_type($post->ID) == 'portfolio') {
                    $suggestion['post_type'] = __('Portfolio Item', NECTAR_THEME_NAME);
                    //show custom thumbnail if in use
                    $custom_thumbnail = get_post_meta($post->ID, '_nectar_portfolio_custom_thumbnail', true);
                    if (!empty($custom_thumbnail)) {
                        $attachment_id = pn_get_attachment_id_from_url($custom_thumbnail);
                        $suggestion['image'] = wp_get_attachment_image($attachment_id, 'portfolio-widget');
                    }
                } else {
                    if (get_post_type($post->ID) == 'product') {
                        $suggestion['post_type'] = __('Product', NECTAR_THEME_NAME);
                    }
                }
            }
        }
        // Add suggestion to suggestions array
        $suggestions[] = $suggestion;
    }
    // JSON encode and echo
    $response = htmlentities($_GET["callback"], ENT_QUOTES, "UTF-8") . "(" . json_encode($suggestions) . ")";
    echo $response;
    // Don't forget to exit!
    exit;
}
开发者ID:The-Keep-Studios,项目名称:tks-website,代码行数:49,代码来源:wp-search-suggest.php

示例4: get_header

get_header();
?>

<?php 
nectar_page_header(get_option('page_for_posts'));
?>

<div class="container-wrap">
		
	<div class="container main-content">
		
		<div class="row">
			
			<?php 
$options = get_nectar_theme_options();
$blog_type = $options['blog_type'];
if ($blog_type == null) {
    $blog_type = 'std-blog-sidebar';
}
$masonry_class = null;
$masonry_style = null;
$infinite_scroll_class = null;
$load_in_animation = !empty($options['blog_loading_animation']) ? $options['blog_loading_animation'] : 'none';
//enqueue masonry script if selected
if ($blog_type == 'masonry-blog-sidebar' || $blog_type == 'masonry-blog-fullwidth' || $blog_type == 'masonry-blog-full-screen-width') {
    $masonry_class = 'masonry';
}
if ($blog_type == 'masonry-blog-full-screen-width') {
    $masonry_class = 'masonry full-width-content';
}
开发者ID:The-Keep-Studios,项目名称:tks-website,代码行数:30,代码来源:index.php

示例5: nectar_metabox_posts

function nectar_metabox_posts()
{
    $options = get_nectar_theme_options();
    if (!empty($options['transparent-header']) && $options['transparent-header'] == '1') {
        $disable_transparent_header = array('name' => __('Disable Transparency From Navigation', NECTAR_THEME_NAME), 'desc' => __('You can use this option to force your navigation header to stay a solid color even if it qaulifies to trigger to <a target="_blank" href="' . admin_url('?page=redux_options&tab=4#header-padding') . '"> transparent effect</a> you have activate in the Salient options panel.', NECTAR_THEME_NAME), 'id' => '_disable_transparent_header', 'type' => 'checkbox', 'std' => '');
    } else {
        $disable_transparent_header = null;
    }
    if (floatval(get_bloginfo('version')) < "3.6") {
        #-----------------------------------------------------------------#
        # Gallery
        #-----------------------------------------------------------------#
        $meta_box = array('id' => 'nectar-metabox-post-gallery', 'title' => __('Gallery Settings', NECTAR_THEME_NAME), 'description' => __('Please use the sections that have appeared under the Featured Image block labeled "Second Slide, Third Slide..." etc to add images to your gallery.', NECTAR_THEME_NAME), 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array());
        $callback = create_function('$post,$meta_box', 'nectar_create_meta_box( $post, $meta_box["args"] );');
        add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    } else {
        $meta_box = array('id' => 'nectar-metabox-post-gallery', 'title' => __('Gallery Configuration', NECTAR_THEME_NAME), 'description' => 'Once you\'ve inserted a WordPress gallery using the "Add Media" button above, you can use the gallery slider checkbox below to transform your images into a slider.', 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Gallery Slider', NECTAR_THEME_NAME), 'desc' => __('Would you like to turn your gallery into a slider?', NECTAR_THEME_NAME), 'id' => '_nectar_gallery_slider', 'type' => 'checkbox', 'std' => 1)));
        $callback = create_function('$post,$meta_box', 'nectar_create_meta_box( $post, $meta_box["args"] );');
        add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    }
    #-----------------------------------------------------------------#
    # Quote
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-post-quote', 'title' => __('Quote Settings', NECTAR_THEME_NAME), 'description' => '', 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Quote Content', NECTAR_THEME_NAME), 'desc' => __('Please type the text for your quote here.', NECTAR_THEME_NAME), 'id' => '_nectar_quote', 'type' => 'textarea', 'std' => '')));
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Link
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-post-link', 'title' => __('Link Settings', NECTAR_THEME_NAME), 'description' => '', 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Link URL', NECTAR_THEME_NAME), 'desc' => __('Please input the URL for your link. I.e. http://www.themenectar.com', NECTAR_THEME_NAME), 'id' => '_nectar_link', 'type' => 'text', 'std' => '')));
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Video
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-post-video', 'title' => __('Video Settings', 'nectar'), 'description' => '', 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('M4V File URL', NECTAR_THEME_NAME), 'desc' => __('Please upload the .m4v video file. <br/><strong>You must include both formats.</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_video_m4v', 'type' => 'media', 'std' => ''), array('name' => __('OGV File URL', NECTAR_THEME_NAME), 'desc' => __('Please upload the .ogv video file  <br/><strong>You must include both formats.</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_video_ogv', 'type' => 'media', 'std' => ''), array('name' => __('Preview Image', NECTAR_THEME_NAME), 'desc' => __('Image should be at least 680px wide. Click the "Upload" button to begin uploading your image, followed by "Select File" once you have made your selection. Only applies to self hosted videos.', NECTAR_THEME_NAME), 'id' => '_nectar_video_poster', 'type' => 'file', 'std' => ''), array('name' => __('Embedded Code', NECTAR_THEME_NAME), 'desc' => __('If the video is an embed rather than self hosted, enter in a Vimeo or Youtube embed code here. <strong> Embeds work worse with the parallax effect, but if you must use this, Vimeo is recommended. </strong> ', NECTAR_THEME_NAME), 'id' => '_nectar_video_embed', 'type' => 'textarea', 'std' => '')));
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Audio
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-post-audio', 'title' => __('Audio Settings', NECTAR_THEME_NAME), 'description' => '', 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('MP3 File URL', NECTAR_THEME_NAME), 'desc' => __('Please enter in the URL to the .mp3 file', NECTAR_THEME_NAME), 'id' => '_nectar_audio_mp3', 'type' => 'text', 'std' => ''), array('name' => __('OGA File URL', NECTAR_THEME_NAME), 'desc' => __('Please enter in the URL to the .ogg or .oga file', NECTAR_THEME_NAME), 'id' => '_nectar_audio_ogg', 'type' => 'text', 'std' => '')));
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Post Configuration
    #-----------------------------------------------------------------#
    if (!empty($options['blog_masonry_type']) && $options['blog_masonry_type'] == 'meta_overlaid' || !empty($options['blog_masonry_type']) && $options['blog_masonry_type'] == 'classic_enhanced') {
        $meta_box = array('id' => 'nectar-metabox-post-config', 'title' => __('Post Configuration', NECTAR_THEME_NAME), 'description' => __('Configure the various options for how your post will display', NECTAR_THEME_NAME), 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Masonry Item Sizing', NECTAR_THEME_NAME), 'desc' => __('This will only be used if you choose to display your portfolio in the masonry format', NECTAR_THEME_NAME), 'id' => '_post_item_masonry_sizing', 'type' => 'select', 'std' => 'tall_regular', 'options' => array("regular" => "Regular", "wide_tall" => "Regular Alt", "large_featured" => "Large Featured"))));
        add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    }
    #-----------------------------------------------------------------#
    # Header Settings
    #-----------------------------------------------------------------#
    if (!empty($options['blog_header_type']) && $options['blog_header_type'] == 'fullscreen') {
        $header_height = null;
        $bg_overlay = array('name' => __('Background Overlay', NECTAR_THEME_NAME), 'desc' => __('This will add a slight overlay onto your header which will allow lighter text to be easily visible on light images ', NECTAR_THEME_NAME), 'id' => '_nectar_header_overlay', 'type' => 'checkbox', 'std' => 1);
        $bg_bottom_shad = array('name' => __('Bottom Shadow', NECTAR_THEME_NAME), 'desc' => __('This will add a subtle shadow at the bottom of your header', NECTAR_THEME_NAME), 'id' => '_nectar_header_bottom_shadow', 'type' => 'checkbox', 'std' => 1);
    } else {
        $header_height = array('name' => __('Page Header Height', NECTAR_THEME_NAME), 'desc' => __('How tall do you want your header? <br/>Don\'t include "px" in the string. e.g. 350 <br/><strong>This only applies when you are using an image/bg color.</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg_height', 'type' => 'text', 'std' => '');
        $bg_overlay = null;
        $bg_bottom_shad = null;
    }
    $meta_box = array('id' => 'nectar-metabox-page-header', 'title' => __('Post Header Settings', NECTAR_THEME_NAME), 'description' => __('Here you can configure how your page header will appear. ', NECTAR_THEME_NAME), 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Page Header Image', NECTAR_THEME_NAME), 'desc' => __('The image should be between 1600px - 2000px wide and have a minimum height of 475px for best results.', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg', 'type' => 'file', 'std' => ''), array('name' => __('Parallax Header?', NECTAR_THEME_NAME), 'desc' => __('If you would like your header to have a parallax scroll effect check this box.', NECTAR_THEME_NAME), 'id' => '_nectar_header_parallax', 'type' => 'checkbox', 'std' => 1), $header_height, array('name' => __('Page Header Background Color', NECTAR_THEME_NAME), 'desc' => __('Set your desired page header background color if not using an image', NECTAR_THEME_NAME), 'id' => '_nectar_header_bg_color', 'type' => 'color', 'std' => ''), array('name' => __('Page Header Font Color', NECTAR_THEME_NAME), 'desc' => __('Set your desired page header font color - will only be used if using a header bg image/color', NECTAR_THEME_NAME), 'id' => '_nectar_header_font_color', 'type' => 'color', 'std' => ''), $bg_overlay, $bg_bottom_shad, $disable_transparent_header));
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
}
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:62,代码来源:post-meta.php

示例6: generate_options_css

function generate_options_css()
{
    $options = get_nectar_theme_options();
    if (!empty($options['external-dynamic-css']) && $options['external-dynamic-css'] == 1) {
        $css_dir = get_stylesheet_directory() . '/css/';
        // Shorten code, save 1 call
        ob_start();
        // Capture all output (output buffering)
        //include css
        nectar_colors_css_output();
        nectar_custom_css_output();
        //if(!empty($options['use-custom-fonts']) && $options['use-custom-fonts'] == 1){
        nectar_fonts_output();
        //}
        $css = ob_get_clean();
        // Get generated CSS (output buffering)
        file_put_contents($css_dir . 'dynamic-combined.css', $css, LOCK_EX);
        // Save it
    }
}
开发者ID:tyburrowbridge,项目名称:tmb,代码行数:20,代码来源:functions.php

示例7: nectar_recent_projects

function nectar_recent_projects($atts, $content = null)
{
    extract(shortcode_atts(array("title_labels" => 'false', 'project_style' => '', 'heading' => '', 'page_link_text' => '', 'control_text_color' => 'dark', 'page_link_url' => '', 'hide_controls' => 'false', 'lightbox_only' => '0', 'number_to_display' => '6', 'full_width' => 'false', 'category' => 'all'), $atts));
    global $post;
    global $options;
    global $nectar_love;
    $options = get_nectar_theme_options();
    $title_label_output = null;
    $recent_projects_title_text = !empty($options['carousel-title']) ? $options['carousel-title'] : 'Recent Work';
    $recent_projects_link_text = !empty($options['carousel-link']) ? $options['carousel-link'] : 'View All Work';
    $portfolio_link = get_portfolio_page_link(get_the_ID());
    if (!empty($options['main-portfolio-link'])) {
        $portfolio_link = $options['main-portfolio-link'];
    }
    //project style
    if (empty($project_style) && $full_width == 'true') {
        $project_style = '2';
    } elseif (empty($project_style) && $full_width == 'false') {
        $project_style = '1';
    }
    $full_width_carousel = $full_width == 'true' ? 'true' : 'false';
    //incase only all was selected
    if ($category == 'all') {
        $category = null;
    }
    $projects_to_display = intval($number_to_display) == 0 ? '6' : $number_to_display;
    if (!empty($heading)) {
        if ($full_width_carousel == 'true') {
            $title_label_output = '<h2>' . $heading . '</h2>';
        } else {
            $title_label_output = '<h2>' . $heading;
            if (!empty($page_link_text)) {
                $title_label_output .= '<a href="' . $page_link_url . '" class="button"> / ' . $page_link_text . '</a>';
            }
            $title_label_output .= '</h2>';
        }
    }
    //keep old label option to not break legacy users
    if ($title_labels == 'true') {
        $title_label_output = '<h2>' . $recent_projects_title_text;
        if (!empty($recent_projects_link_text) && strlen($recent_projects_link_text) > 2) {
            $title_label_output .= '<a href="' . $portfolio_link . '" class="button"> / ' . $recent_projects_link_text . '</a>';
        }
        $title_label_output .= '</h2>';
    }
    $portfolio = array('posts_per_page' => $projects_to_display, 'post_type' => 'portfolio', 'project-type' => $category);
    $the_query = new WP_Query($portfolio);
    if ($full_width_carousel == 'true') {
        $arrow_markup = '<div class="controls"><a class="portfolio-page-link" href="' . $page_link_url . '"><i class="icon-salient-back-to-all"></i></a>
									 <a class="carousel-prev" href="#"><i class="icon-salient-left-arrow-thin"></i></a>
					    	         <a class="carousel-next" href="#"><i class="icon-salient-right-arrow-thin"></i></a></div>';
    } else {
        $arrow_markup = '<div class="control-wrap"><a class="carousel-prev" href="#"><i class="icon-angle-left"></i></a>
					    	         <a class="carousel-next" href="#"><i class="icon-angle-right"></i></a></div>';
    }
    if ($hide_controls == 'true') {
        $arrow_markup = null;
    }
    ?>
 
				
				<?php 
    if ($the_query->have_posts()) {
        $default_style = $project_style == '1' ? 'default-style' : null;
        $recent_projects_content = '<div class="carousel-wrap recent-work-carousel ' . $default_style . '" data-ctc="' . $control_text_color . '" data-full-width="' . $full_width_carousel . '">
					
					<div class="carousel-heading"><div class="container">' . $title_label_output . $arrow_markup . '</div></div>
					
					<ul class="row portfolio-items text-align-center carousel" data-scroll-speed="800" data-easing="easeInOutQuart">';
    }
    //standard layout
    if ($project_style == '1') {
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                $video_embed = get_post_meta($post->ID, '_nectar_video_embed', true);
                $video_m4v = get_post_meta($post->ID, '_nectar_video_m4v', true);
                $media = null;
                $date = null;
                $love = $nectar_love->add_love();
                $custom_project_link = get_post_meta($post->ID, '_nectar_external_project_url', true);
                $the_project_link = !empty($custom_project_link) ? $custom_project_link : get_permalink();
                //video
                if (!empty($video_embed) || !empty($video_m4v)) {
                    if (!empty($video_embed) && floatval(get_bloginfo('version')) < "3.6") {
                        $media .= '<a href="#video-popup-' . $post->ID . '" class="pretty_photo default-link">' . __("Watch Video", NECTAR_THEME_NAME) . ' </a> ';
                        $media .= '<div id="video-popup-' . $post->ID . '">';
                        $media .= '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                        $media .= '</div>';
                    } else {
                        $media .= '<a href="' . get_template_directory_uri() . '/includes/portfolio-functions/video.php?post-id=' . $post->ID . '&iframe=true&width=854" class="pretty_photo default-link" >' . __("Watch Video", NECTAR_THEME_NAME) . '</a> ';
                    }
                } else {
                    $media .= '<a href="' . $featured_image[0] . '" class="pretty_photo default-link">' . __("View Larger", NECTAR_THEME_NAME) . '</a> ';
                }
                $project_excerpt = get_post_meta($post->ID, '_nectar_project_excerpt', true);
                if (!empty($project_excerpt)) {
                    $date = '<p>' . $project_excerpt . '</p>';
                } elseif (!empty($options['portfolio_date']) && $options['portfolio_date'] == 1) {
//.........这里部分代码省略.........
开发者ID:JPodz,项目名称:harlequinnejuice,代码行数:101,代码来源:shortcode-processing.php


注:本文中的get_nectar_theme_options函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。