Ejemplo n.º 1
0
 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>';
     }
 }
Ejemplo n.º 2
0
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);
}
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;
}
Ejemplo n.º 4
0
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';
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
function nectar_metabox_portfolio()
{
    $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;
    }
    #-----------------------------------------------------------------#
    # Extra Content
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-portfolio-extra', 'title' => __('Extra Content', NECTAR_THEME_NAME), 'description' => __('Please use this section to place any extra content you would like to appear in the main content area under your portfolio item. (The above default editor is only used to populate your items sidebar content)', NECTAR_THEME_NAME), 'post_type' => 'portfolio', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => '', 'desc' => '', 'id' => '_nectar_portfolio_extra_content', 'type' => 'editor', 'std' => '')));
    $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_pages = array('default' => 'Default');
    //grab all pages that are using the portfolio layout
    $portfolio_pages_ft = get_pages(array('meta_key' => '_wp_page_template', 'meta_value' => 'page-portfolio.php'));
    if (!empty($portfolio_pages_ft)) {
        foreach ($portfolio_pages_ft as $page) {
            $portfolio_pages[$page->ID] = $page->post_title;
        }
    }
    $portfolio_pages_ft_new = get_pages(array('meta_key' => '_wp_page_template', 'meta_value' => 'template-portfolio.php'));
    if (!empty($portfolio_pages_ft_new)) {
        foreach ($portfolio_pages_ft_new as $page) {
            $portfolio_pages[$page->ID] = $page->post_title;
        }
    }
    //grab all pages that contain the portfolio shortcode
    global $wpdb;
    $results = $wpdb->get_results("SELECT * FROM {$wpdb->posts}\r\n\tWHERE post_content LIKE '%[nectar_portfolio%' AND post_type='page'");
    if (!empty($results)) {
        foreach ($results as $result) {
            $portfolio_pages[$result->ID] = $result->post_title;
        }
    }
    #-----------------------------------------------------------------#
    # Project Configuration
    #-----------------------------------------------------------------#
    if (floatval(get_bloginfo('version')) < "3.6") {
        $meta_box = array('id' => 'nectar-metabox-custom-thummbnail', 'title' => __('Project Configuration', NECTAR_THEME_NAME), 'description' => __('', NECTAR_THEME_NAME), 'post_type' => 'portfolio', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Full Width Portfolio Item Layout', NECTAR_THEME_NAME), 'desc' => __('This will remove the sidebar and allow you to use fullwidth sections and sliders', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_item_layout', 'type' => 'choice_below', 'options' => array('disabled' => 'Disabled', 'enabled' => 'Enabled'), 'std' => 'disabled'), array('name' => __('Custom Thumbnail Image', NECTAR_THEME_NAME), 'desc' => __('If you would like to have a separate thumbnail for your portfolio item, upload it here. If left blank, a cropped version of your featured image will be automatically used instead. The recommended dimensions are 600px by 403px.', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_custom_thumbnail', 'type' => 'file', 'std' => ''), array('name' => __('Hide Featured Image/Video on Single Project Page?', NECTAR_THEME_NAME), 'desc' => __('You can choose to hide your featured image/video from automatically displaying on the top of the main project page.', NECTAR_THEME_NAME), 'id' => '_nectar_hide_featured', 'type' => 'checkbox', 'std' => 1), 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' => '_portfolio_item_masonry_sizing', 'type' => 'select', 'std' => 'tall_regular', 'options' => array("regular" => "Regular", "wide" => "Wide", "tall" => "Tall", "wide_tall" => "Wide & Tall")), array('name' => __('Masonry Content Position', NECTAR_THEME_NAME), 'desc' => __('This will only be used on project styles which show the content overlaid before hover', NECTAR_THEME_NAME), 'id' => '_portfolio_item_masonry_content_pos', 'type' => 'select', 'std' => 'middle', 'options' => array("middle" => "Middle", "left" => "Left", "right" => "Right", "top" => "Top", "bottom" => "Bottom")), array('name' => __('External Project URL', NECTAR_THEME_NAME), 'desc' => __('If you would like your project to link to a custom location, enter it here (remember to include "http://")', NECTAR_THEME_NAME), 'id' => '_nectar_external_project_url', 'type' => 'text', 'std' => ''), array('name' => __('Parent Portfolio Override', NECTAR_THEME_NAME), 'desc' => __('This allows you to manually assign where your "Back to all" button will take the user on your single portfolio item pages.', NECTAR_THEME_NAME), 'id' => 'nectar-metabox-portfolio-parent-override', 'type' => 'select', 'options' => $portfolio_pages, 'std' => 'default'), array('name' => __('Project Excerpt', NECTAR_THEME_NAME), 'desc' => __('If you would like your project to display a small excerpt of text under the title in portfolio element, enter it here.', NECTAR_THEME_NAME), 'id' => '_nectar_project_excerpt', 'type' => 'text', 'std' => '')));
    } else {
        //show gallery slider option for legacy users only if they're using it
        global $post;
        if ($post) {
            $using_gallery_slider = get_post_meta($post->ID, '_nectar_gallery_slider', true);
            if (!empty($using_gallery_slider) && $using_gallery_slider == 'on') {
                $gallery_slider = array('name' => __('Gallery Slider', NECTAR_THEME_NAME), 'desc' => __('This will turn all default WordPress galleries attached to this post into a simple slider.', NECTAR_THEME_NAME), 'id' => '_nectar_gallery_slider', 'type' => 'checkbox', 'std' => 1);
            } else {
                $gallery_slider = null;
            }
        } else {
            $gallery_slider = null;
        }
        $meta_box = array('id' => 'nectar-metabox-project-configuration', 'title' => __('Project Configuration', NECTAR_THEME_NAME), 'description' => __('', NECTAR_THEME_NAME), 'post_type' => 'portfolio', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Full Width Portfolio Item Layout', NECTAR_THEME_NAME), 'desc' => __('This will remove the sidebar and allow you to use fullwidth sections and sliders', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_item_layout', 'type' => 'choice_below', 'options' => array('disabled' => 'Disabled', 'enabled' => 'Enabled'), 'std' => 'disabled'), array('name' => __('Custom Content Grid Item', NECTAR_THEME_NAME), 'desc' => __('This will all you to place custom content using the above editor that will appear in your portfolio grid. By using this option the single project page will be disabled, however you can still link the item to a custom URL if desired.', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_custom_grid_item', 'type' => 'choice_below', 'options' => array('off' => 'Disabled', 'on' => 'Enabled'), 'std' => 'off'), array('name' => __('Custom Content Grid Item Content', NECTAR_THEME_NAME), 'desc' => __('Use this to populate what will display as your project content in place of the default meta info', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_custom_grid_item_content', 'type' => 'slim_editor', 'std' => ''), array('name' => __('Custom Thumbnail Image', NECTAR_THEME_NAME), 'desc' => __('If you would like to have a separate thumbnail for your portfolio item, upload it here. If left blank, a cropped version of your featured image will be automatically used instead. The recommended dimensions are 600px by 403px.', NECTAR_THEME_NAME), 'id' => '_nectar_portfolio_custom_thumbnail', 'type' => 'file', 'std' => ''), array('name' => __('Hide Featured Image/Video on Single Project Page?', NECTAR_THEME_NAME), 'desc' => __('You can choose to hide your featured image/video from automatically displaying on the top of the main project page.', NECTAR_THEME_NAME), 'id' => '_nectar_hide_featured', 'type' => 'checkbox', 'std' => 1), 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' => '_portfolio_item_masonry_sizing', 'type' => 'select', 'std' => 'tall_regular', 'options' => array("regular" => "Regular", "wide" => "Wide", "tall" => "Tall", "wide_tall" => "Wide & Tall")), array('name' => __('Masonry Content Position', NECTAR_THEME_NAME), 'desc' => __('This will only be used on project styles which show the content overlaid before hover', NECTAR_THEME_NAME), 'id' => '_portfolio_item_masonry_content_pos', 'type' => 'select', 'std' => 'middle', 'options' => array("middle" => "Middle", "left" => "Left", "right" => "Right", "top" => "Top", "bottom" => "Bottom")), $gallery_slider, array('name' => __('External Project URL', NECTAR_THEME_NAME), 'desc' => __('If you would like your project to link to a custom location, enter it here (remember to include "http://")', NECTAR_THEME_NAME), 'id' => '_nectar_external_project_url', 'type' => 'text', 'std' => ''), array('name' => __('Parent Portfolio Override', NECTAR_THEME_NAME), 'desc' => __('This allows you to manually assign where your "Back to all" button will take the user on your single portfolio item pages.', NECTAR_THEME_NAME), 'id' => 'nectar-metabox-portfolio-parent-override', 'type' => 'select', 'options' => $portfolio_pages, 'std' => 'default'), array('name' => __('Project Excerpt', NECTAR_THEME_NAME), 'desc' => __('If you would like your project to display a small excerpt of text under the title in portfolio element, enter it here.', NECTAR_THEME_NAME), 'id' => '_nectar_project_excerpt', 'type' => 'text', 'std' => ''), array('name' => __('Project Accent Color', NECTAR_THEME_NAME), 'desc' => __('This will be used in applicable project styles in the portfolio thumbnail view.', NECTAR_THEME_NAME), 'id' => '_nectar_project_accent_color', 'type' => 'color', 'std' => ''), array('name' => __('Project Title Color', NECTAR_THEME_NAME), 'desc' => __('This will be used in applicable project styles in the portfolio thumbnail view.', NECTAR_THEME_NAME), 'id' => '_nectar_project_title_color', 'type' => 'color', 'std' => ''), array('name' => __('Project Date/Custom excerpt Color', NECTAR_THEME_NAME), 'desc' => __('This will be used in applicable project styles in the portfolio thumbnail view.', NECTAR_THEME_NAME), 'id' => '_nectar_project_subtitle_color', 'type' => 'color', 'std' => '')));
    }
    //endif
    add_meta_box($meta_box['id'], $meta_box['title'], $callback, $meta_box['post_type'], $meta_box['context'], $meta_box['priority'], $meta_box);
    #-----------------------------------------------------------------#
    # Header Settings
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-page-header', 'title' => __('Project Header Settings', NECTAR_THEME_NAME), 'description' => __('Here you can configure how your page header will appear. ', NECTAR_THEME_NAME), 'post_type' => 'portfolio', '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), 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' => __('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 Subtitle', NECTAR_THEME_NAME), 'desc' => __('Enter in the page header subtitle', NECTAR_THEME_NAME), 'id' => '_nectar_header_subtitle', 'type' => 'text', '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' => ''), $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);
    #-----------------------------------------------------------------#
    # Video
    #-----------------------------------------------------------------#
    $meta_box = array('id' => 'nectar-metabox-portfolio-video', 'title' => __('Video Settings', NECTAR_THEME_NAME), 'description' => __('If you have a video, please fill out the fields below.', NECTAR_THEME_NAME), 'post_type' => 'portfolio', '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' => __('Video Height', NECTAR_THEME_NAME), 'desc' => __('This only needs to be filled out if your self hosted video is not in a 16:9 aspect ratio. Enter your height based on an 845px width. This is used to calculate the iframe height for the "Watch Video" link. <br/> <strong>Don\'t include "px" in the string. e.g. 480</strong>', NECTAR_THEME_NAME), 'id' => '_nectar_video_height', 'type' => 'text', '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 Youtube or Vimeo embed code here. The width should be a minimum of 670px with any height.', 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);
}
Ejemplo n.º 7
0
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
    }
}
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) {
                    $date = '<p>' . get_the_date() . '</p>';
                }
                $project_img = '<img src="' . get_template_directory_uri() . '/img/no-portfolio-item-small.jpg" alt="no image added yet." />';
                if (has_post_thumbnail()) {
                    $project_img = get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                }
                //custom thumbnail
                $custom_thumbnail = get_post_meta($post->ID, '_nectar_portfolio_custom_thumbnail', true);
                if (!empty($custom_thumbnail)) {
                    $project_img = '<img class="custom-thumbnail" src="' . $custom_thumbnail . '" alt="' . get_the_title() . '" />';
                }
                $more_details_html = $lightbox_only != 'true' ? '<a class="default-link" href="' . $the_project_link . '">' . __("More Details", NECTAR_THEME_NAME) . '</a>' : null;
                $project_accent_color = get_post_meta($post->ID, '_nectar_project_accent_color', true);
                if (!empty($project_accent_color)) {
                    $project_accent_color_markup = 'data-project-color="' . $project_accent_color . '"';
                } else {
                    $project_accent_color_markup = 'data-default-color="true"';
                }
                $project_title_color = get_post_meta($post->ID, '_nectar_project_title_color', true);
                $project_subtitle_color = get_post_meta($post->ID, '_nectar_project_subtitle_color', true);
                $using_custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item', true);
                $custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item_content', true);
                $recent_projects_content .= '<li class="col span_4" ' . $project_accent_color_markup . ' data-title-color="' . $project_title_color . '" data-subtitle-color="' . $project_subtitle_color . '">
							<div class="inner-wrap animated" data-animation="none">
							<div class="work-item" data-custom-content="' . $using_custom_content . '">' . $project_img . '
			
								<div class="work-info-bg"></div>
								<div class="work-info">';
                if ($using_custom_content == 'on') {
                    if (!empty($custom_project_link)) {
                        echo '<a href="' . $the_project_link . '"></a>';
                    }
                    $recent_projects_content .= '<div class="vert-center"><div class="custom-content">' . do_shortcode($custom_content) . '</div></div>';
                    //default
                } else {
                    $recent_projects_content .= '<div class="vert-center">' . $media . $more_details_html . '</div><!--/vert-center-->';
                }
                $recent_projects_content .= '</div>
							</div><!--work-item-->
							
							<div class="work-meta">
								<h4 class="title"> ' . get_the_title() . '</h4>
								' . $date . '
							</div><div class="nectar-love-wrap">
							
							' . $love . '</div>
							
							<div class="clear"></div>
							</div>
						</li><!--/span_4-->';
            }
        }
    } elseif ($project_style == '2') {
        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();
                $margin = $full_width_carousel == 'true' ? 'no-margin' : null;
                $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();
                $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) {
                    $date = '<p>' . get_the_date() . '</p>';
                }
                $project_img = '<img src="' . get_template_directory_uri() . '/img/no-portfolio-item-small.jpg" alt="no image added yet." />';
                if (has_post_thumbnail()) {
                    $project_img = get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                }
                //custom thumbnail
                $custom_thumbnail = get_post_meta($post->ID, '_nectar_portfolio_custom_thumbnail', true);
                if (!empty($custom_thumbnail)) {
                    $project_img = '<img class="custom-thumbnail" src="' . $custom_thumbnail . '" alt="' . get_the_title() . '" />';
                }
                if ($lightbox_only != 'true') {
                    $link_markup = '<a href="' . $the_project_link . '"></a>';
                } else {
                    //video
                    if (!empty($video_embed) || !empty($video_m4v)) {
                        if (!empty($video_embed) && floatval(get_bloginfo('version')) < "3.6") {
                            $link_markup = '<a href="#video-popup-' . $post->ID . '" class="pretty_photo"> </a> ';
                            $link_markup .= '<div id="video-popup-' . $post->ID . '">';
                            $link_markup .= '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                            $link_markup .= '</div>';
                        } else {
                            $link_markup = '<a href="' . get_template_directory_uri() . '/includes/portfolio-functions/video.php?post-id=' . $post->ID . '&iframe=true&width=854" class="pretty_photo" ></a> ';
                        }
                    } else {
                        $link_markup = '<a href="' . $featured_image[0] . '" class="pretty_photo"></a>';
                    }
                }
                $project_accent_color = get_post_meta($post->ID, '_nectar_project_accent_color', true);
                if (!empty($project_accent_color)) {
                    $project_accent_color_markup = 'data-project-color="' . $project_accent_color . '"';
                } else {
                    $project_accent_color_markup = 'data-default-color="true"';
                }
                $project_title_color = get_post_meta($post->ID, '_nectar_project_title_color', true);
                $project_subtitle_color = get_post_meta($post->ID, '_nectar_project_subtitle_color', true);
                $using_custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item', true);
                $custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item_content', true);
                $recent_projects_content .= '<li class="col span_4 ' . $margin . '" ' . $project_accent_color_markup . ' data-title-color="' . $project_title_color . '" data-subtitle-color="' . $project_subtitle_color . '">
							
							<div class="work-item style-2" data-custom-content="' . $using_custom_content . '">' . $project_img . '
			
								<div class="work-info-bg"></div>
								<div class="work-info">
									
									
									' . $link_markup;
                if ($using_custom_content == 'on') {
                    if (!empty($custom_project_link)) {
                        echo '<a href="' . $the_project_link . '"></a>';
                    }
                    $recent_projects_content .= '<div class="vert-center"><div class="custom-content">' . do_shortcode($custom_content) . '</div></div>';
                    //default
                } else {
                    $recent_projects_content .= '<div class="vert-center"><h3>' . get_the_title() . '</h3> ' . $date . '</div><!--/vert-center-->';
                }
                $recent_projects_content .= '</div>
							</div><!--work-item-->

						</li><!--/span_4-->';
            }
        }
    } elseif ($project_style == '3') {
        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();
                $margin = $full_width_carousel == 'true' ? 'no-margin' : null;
                $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();
                $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) {
                    $date = '<p>' . get_the_date() . '</p>';
                }
                $project_img = '<img src="' . get_template_directory_uri() . '/img/no-portfolio-item-small.jpg" alt="no image added yet." />';
                if (has_post_thumbnail()) {
                    $project_img = get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                }
                //custom thumbnail
                $custom_thumbnail = get_post_meta($post->ID, '_nectar_portfolio_custom_thumbnail', true);
                if (!empty($custom_thumbnail)) {
                    $project_img = '<img class="custom-thumbnail" src="' . $custom_thumbnail . '" alt="' . get_the_title() . '" />';
                }
                if ($lightbox_only != 'true') {
                    $link_markup = '<a href="' . $the_project_link . '"></a>';
                } else {
                    //video
                    if (!empty($video_embed) || !empty($video_m4v)) {
                        if (!empty($video_embed) && floatval(get_bloginfo('version')) < "3.6") {
                            $link_markup = '<a href="#video-popup-' . $post->ID . '" class="pretty_photo"> </a> ';
                            $link_markup .= '<div id="video-popup-' . $post->ID . '">';
                            $link_markup .= '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                            $link_markup .= '</div>';
                        } else {
                            $link_markup = '<a href="' . get_template_directory_uri() . '/includes/portfolio-functions/video.php?post-id=' . $post->ID . '&iframe=true&width=854" class="pretty_photo" ></a> ';
                        }
                    } else {
                        $link_markup = '<a href="' . $featured_image[0] . '" class="pretty_photo"></a>';
                    }
                }
                $project_accent_color = get_post_meta($post->ID, '_nectar_project_accent_color', true);
                if (!empty($project_accent_color)) {
                    $project_accent_color_markup = 'data-project-color="' . $project_accent_color . '"';
                } else {
                    $project_accent_color_markup = 'data-default-color="true"';
                }
                $project_title_color = get_post_meta($post->ID, '_nectar_project_title_color', true);
                $project_subtitle_color = get_post_meta($post->ID, '_nectar_project_subtitle_color', true);
                $using_custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item', true);
                $custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item_content', true);
                $recent_projects_content .= '<li class="col span_4 ' . $margin . '" ' . $project_accent_color_markup . ' data-title-color="' . $project_title_color . '" data-subtitle-color="' . $project_subtitle_color . '">
								
								<div class="work-item style-3" data-custom-content="' . $using_custom_content . '">' . $project_img . '
				
									<div class="work-info-bg"></div>
									<div class="work-info">
										
										' . $link_markup;
                if (!empty($using_custom_content) && $using_custom_content == 'on') {
                    if (!empty($custom_project_link)) {
                        echo '<a href="' . $the_project_link . '"></a>';
                    }
                    $recent_projects_content .= '<div class="vert-center"><div class="custom-content">' . do_shortcode($custom_content) . '</div></div>';
                    //default
                } else {
                    $recent_projects_content .= '<div class="vert-center"><h3>' . get_the_title() . '</h3>' . $date . '</div><!--/vert-center-->';
                }
                $recent_projects_content .= '</div>
								</div><!--work-item-->
	
							</li><!--/span_4-->';
            }
        }
    } elseif ($project_style == '4') {
        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();
                $margin = $full_width_carousel == 'true' ? 'no-margin' : null;
                $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();
                $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) {
                    $date = '<p>' . get_the_date() . '</p>';
                }
                $project_img = '<img src="' . get_template_directory_uri() . '/img/no-portfolio-item-small.jpg" alt="no image added yet." />';
                if (has_post_thumbnail()) {
                    $project_img = get_the_post_thumbnail($post->ID, 'portfolio-thumb', array('title' => ''));
                }
                //custom thumbnail
                $custom_thumbnail = get_post_meta($post->ID, '_nectar_portfolio_custom_thumbnail', true);
                if (!empty($custom_thumbnail)) {
                    $project_img = '<img class="custom-thumbnail" src="' . $custom_thumbnail . '" alt="' . get_the_title() . '" />';
                }
                if ($lightbox_only != 'true') {
                    $link_markup = '<a href="' . $the_project_link . '"></a>';
                } else {
                    //video
                    if (!empty($video_embed) || !empty($video_m4v)) {
                        if (!empty($video_embed) && floatval(get_bloginfo('version')) < "3.6") {
                            $link_markup = '<a href="#video-popup-' . $post->ID . '" class="pretty_photo"> </a> ';
                            $link_markup .= '<div id="video-popup-' . $post->ID . '">';
                            $link_markup .= '<div class="video-wrap">' . stripslashes(htmlspecialchars_decode($video_embed)) . '</div>';
                            $link_markup .= '</div>';
                        } else {
                            $link_markup = '<a href="' . get_template_directory_uri() . '/includes/portfolio-functions/video.php?post-id=' . $post->ID . '&iframe=true&width=854" class="pretty_photo" ></a> ';
                        }
                    } else {
                        $link_markup = '<a href="' . $featured_image[0] . '" class="pretty_photo"></a>';
                    }
                }
                $project_accent_color = get_post_meta($post->ID, '_nectar_project_accent_color', true);
                if (!empty($project_accent_color)) {
                    $project_accent_color_markup = 'data-project-color="' . $project_accent_color . '"';
                } else {
                    $project_accent_color_markup = 'data-default-color="true"';
                }
                $project_title_color = get_post_meta($post->ID, '_nectar_project_title_color', true);
                $project_subtitle_color = get_post_meta($post->ID, '_nectar_project_subtitle_color', true);
                $using_custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item', true);
                $custom_content = get_post_meta($post->ID, '_nectar_portfolio_custom_grid_item_content', true);
                $recent_projects_content .= '<li class="col span_4 ' . $margin . '" ' . $project_accent_color_markup . ' data-title-color="' . $project_title_color . '" data-subtitle-color="' . $project_subtitle_color . '">
								
								<div class="work-item style-4" data-custom-content="' . $using_custom_content . '">' . $project_img . '
				
									<div class="work-info">
										
										' . $link_markup;
                if (!empty($using_custom_content) && $using_custom_content == 'on') {
                    if (!empty($custom_project_link)) {
                        echo '<a href="' . $the_project_link . '"></a>';
                    }
                    $recent_projects_content .= '<div class="vert-center"><div class="custom-content">' . do_shortcode($custom_content) . '</div></div>';
                    //default
                } else {
                    $recent_projects_content .= '<div class="bottom-meta"><h3>' . get_the_title() . '</h3>' . $date . '</div><!--/bottom-meta-->';
                }
                $recent_projects_content .= '</div>
								</div><!--work-item-->
	
							</li><!--/span_4-->';
            }
        }
    }
    //project style 4
    if ($the_query->have_posts()) {
        $recent_projects_content .= '</ul><!--/carousel--></div><!--/carousel-wrap-->';
    }
    wp_reset_postdata();
    return $recent_projects_content;
}