" title="<?php 
            echo $NV_posttitle;
            ?>
"><?php 
        }
        echo $NV_posttitle;
        if ($NV_disablegallink != 'yes') {
            ?>
</a><?php 
        }
        ?>
</h2>
			
			<?php 
        if ($NV_groupgridcontent != "titleimage") {
            echo do_shortcode($NV_description);
            if ($NV_disablegallink != 'yes' && $NV_disablereadmore != 'yes') {
                echo themeva_readmore($NV_galexturl);
            }
        }
        ?>
       		</div>
		</div><!-- /excerpt --> 
     
<?php 
    }
}
// end post format
?>
</li>
Example #2
0
function nv_recent_posts_shortcode($atts)
{
    extract(shortcode_atts(array('limit' => '', 'categories' => '', 'metadata' => '', 'show_date' => '', 'order' => 'date', 'orderby' => '', 'offset' => '', 'image_width' => '', 'image_height' => '', 'image_align' => '', 'image_effect' => '', 'content_type' => '', 'content' => 'textimage', 'excerpt' => ''), $atts));
    if (!empty($content_type)) {
        $content = $content_type;
    }
    ob_start();
    $q = new WP_Query('offset=' . $offset . '&orderby=' . $order . '&order=' . $orderby . '&category_name=' . $categories . '&posts_per_page=' . $limit);
    if (esc_attr($excerpt)) {
        $recent_excerpt = esc_attr($excerpt);
    } else {
        $recent_excerpt = "15";
    }
    ?>
		
		<ul class="nv-recent-posts">
		
		<?php 
    while ($q->have_posts()) {
        $q->the_post();
        $post_id = get_the_ID();
        $NV_previewimgurl = get_post_meta($post_id, '_cmb_previewimgurl', true) != '' ? get_post_meta($post_id, '_cmb_previewimgurl', true) : '';
        $disablegallink = get_post_meta($post_id, '_cmb_disablegallink', true) != '' ? get_post_meta($post_id, '_cmb_disablegallink', true) : '';
        $disablereadmore = get_post_meta($post_id, '_cmb_disablereadmore', true) != '' ? get_post_meta($post_id, '_cmb_disablereadmore', true) : '';
        $link_url = get_post_meta($post_id, '_cmb_galexturl', true) != '' ? get_post_meta($post_id, '_cmb_galexturl', true) : get_permalink();
        // check what image to use, custom, featured, image within post.
        if (empty($NV_previewimgurl)) {
            $post_image_id = get_post_thumbnail_id(get_the_ID());
            if ($post_image_id) {
                $thumbnail = wp_get_attachment_image_src($post_image_id, 'medium', false);
                $NV_previewimgurl = $thumbnail[0];
                $NV_previewimgurl = parse_url($NV_previewimgurl, PHP_URL_PATH);
                // make relative Image URL
            } else {
                $NV_previewimgurl = catch_image();
                // Check for images within post
            }
        }
        $image = $NV_previewimgurl;
        if ($image && ($content == 'textimage' || $content == 'titleimage' || $content == 'image')) {
            // check if link is disabled
            $image_link = $disablegallink != 'yes' ? $image_link = 'link="' . $link_url . '"' : '';
            $image = '[imageeffect type="' . $image_effect . '" align="' . $image_align . '" width="' . $image_width . '" height="' . $image_height . '"  alt="' . get_the_title() . '" url="' . $image . '" ' . $image_link . ' ]';
        } else {
            $image = '';
        }
        ?>
		
			<li>
				<?php 
        echo do_shortcode($image);
        if ($content != 'image') {
            ?>
					<div>
					<h4>
                    	<?php 
            if ($disablegallink == 'yes') {
                the_title();
            } else {
                ?>
							<a href="<?php 
                echo $link_url;
                ?>
"><?php 
                the_title();
                ?>
</a>
						<?php 
            }
            ?>
                    </h4>    
					<?php 
            if ($show_date == 'yes') {
                ?>
						<small><?php 
                echo get_the_date();
                ?>
</small>
					<?php 
            }
            if ($content != 'titleimage' && $content != 'title') {
                if ($q->post->post_excerpt) {
                    echo "<p>" . get_the_excerpt() . "</p>";
                } else {
                    if (function_exists('the_advanced_excerpt')) {
                        echo the_advanced_excerpt('length=' . $recent_excerpt);
                    } else {
                        echo get_the_content();
                    }
                }
                if ($disablegallink != 'yes' && $disablereadmore != 'yes') {
                    echo themeva_readmore($link_url);
                }
            }
            ?>
					</div>
				<?php 
        }
        if ($metadata == 'yes') {
            ?>
					<div class="recent-metadata">
						<?php 
            echo __('by', 'themeva');
            ?>
 <a href="<?php 
            echo get_author_posts_url(get_the_author_meta('ID'));
            ?>
"><?php 
            echo get_the_author_meta('first_name') . " " . get_the_author_meta('last_name');
            ?>
</a> <span class="subbreak">/</span> 
						<?php 
            echo __('in', 'themeva') . ' ';
            the_category(', ');
            ?>
 <span class="subbreak">/</span> 
						<?php 
            comments_popup_link(__('No Comments', 'themeva') . ' ', '1 ' . __('Comment', 'themeva') . ' ', '% ' . __('Comments', 'themeva'));
            ?>
						<div class="hozbreak clearfix">&nbsp;</div>
					</div>
				<?php 
        }
        ?>
                
				<div class="clear"></div>
			</li>
		<?php 
    }
    wp_reset_query();
    ?>
		
		</ul>
		
		
	<?php 
    $output_string = '';
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;
}
Example #3
0
?>
            
        </header><!-- / .post-titles -->
        
        <section class="entry <?php 
echo $columns;
?>
">
        
            <?php 
echo $NV_description;
if (empty($NV_disablereadmore)) {
    $NV_disablereadmore = '';
}
if ($NV_disablegallink != 'yes' && $NV_disablereadmore != 'yes' && $NV_nolink != 'yes') {
    echo themeva_readmore($post_link);
}
wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'NorthVantage') . '</span>', 'after' => '</div>', 'link_before' => '<span class="pagination">', 'link_after' => '</span>'));
?>
  
        </section><!-- / .entry -->
        
        </div>
    
		<?php 
if ($NV_is_widget != true) {
    // Check if placed within a widget
    ?>
        
        <footer class="row">
        	<section class="twelve columns">
            // Title
            if (!empty($NV_posttitle)) {
                $output .= "\n\t\t" . '<div class="title caption skinset-main nv-skin ' . $NV_cssclasses . '">';
                if ($NV_disablegallink != 'yes') {
                    $output .= '<h3><a href="' . $NV_galexturl . '">' . $NV_posttitle . '</a></h3>';
                } else {
                    $output .= "\n\t\t\t" . '<h3>' . $NV_posttitle . '</h3>';
                }
                $output .= "\n\t\t" . '</div>';
            }
            // Description
            if (!empty($NV_description) && ($NV_groupgridcontent == "textimage" || $NV_groupgridcontent == "titletextoverlay")) {
                $output .= "\n\t\t" . '<div class="content caption skinset-main nv-skin ' . $NV_cssclasses . '">';
                $output .= "\n\t\t\t" . do_shortcode($NV_description);
                if ($NV_disablegallink != 'yes' && $NV_disablereadmore != 'yes') {
                    $output .= themeva_readmore($NV_galexturl);
                }
                $output .= "\n\t\t" . '</div>';
            }
            $output .= "\n\t" . '</div>';
        }
    }
    $output .= "\n" . '</div>';
} else {
    $output .= "\n\t" . '<div class="panel" ' . (!empty($NV_galleryheight) ? 'style="height:' . $NV_galleryheight . 'px;"' : '') . '>';
    $output .= "\n\t\t" . '<div class="panel-inner">';
    if ($NV_gallery_postformat == 'yes') {
        global $NV_is_widget;
        $NV_is_widget = true;
        // stop comments displaying within gallery
        ob_start();