/** * post shortcode * * Options: Show all post / by Category * */ function wpsp_post_shortcode($atts, $content = null) { ob_start(); extract(shortcode_atts(array('term_id' => null, 'post_format' => null, 'post_meta' => null, 'post_excerpt' => null, 'post_style' => null, 'post_offset' => null, 'post_count' => null, 'cols' => null), $atts)); //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array(); if ($post_format != 'post-format-standard') { $args = array('tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array($post_format), 'operator' => 'IN'))); } if ($post_offset != '') { $args = array('offset' => $post_offset); } $defaults = array('post_type' => 'post', 'category__in' => $term_id, 'posts_per_page' => $post_count, 'tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote', 'post-format-audio', 'post-format-gallery', 'post-format-image', 'post-format-link', 'post-format-video'), 'operator' => 'NOT IN'))); $args = wp_parse_args($args, $defaults); extract($args); $post_query = new WP_Query($args); if ($post_query->have_posts()) { ?> <div class="wpsp-row clearfix"> <?php while ($post_query->have_posts()) { $post_query->the_post(); ?> <?php // entry-class $entry_classes = array('entry-blog-article'); $entry_classes[] = $post_style; $entry_classes[] = 'col'; $entry_classes[] = wpsp_grid_class($cols); ?> <article id="post-<?php the_ID(); ?> " <?php post_class($entry_classes); ?> > <?php if ('overlay-2' == $post_style) { ?> <div class="post-thumbnail-wrap overlay-2"> <div class="post-thumbnail"><?php wpsp_get_post_thumbnail('thumb-full'); ?> </div> <div class="caption-wrap"> <div class="caption-inner"> <a href="<?php wpsp_permalink(); ?> " title="<?php echo wpsp_esc_title(); ?> " rel="bookmark"><span class="title"><?php the_title(); ?> </span></a> </div> </div> </div> <?php } else { ?> <?php printf('<div class="post-thumbnail"><a itemprop="url" href="%1$s" rel="bookmark" title="%2$s">%3$s</a></div>', wpsp_get_permalink(), wpsp_get_esc_title(), wpsp_post_thumbnail('thumb-full')); ?> <div class="entry-post-content-wrap"> <div class="entry-blog-content"> <?php get_template_part('template-parts/blog/blog-entry-title'); ?> <?php if ($post_meta) { get_template_part('template-parts/blog/blog-entry-meta'); } ?> </div> <?php if ($post_excerpt) { get_template_part('template-parts/blog/blog-entry-excerpt'); } ?> </div> <!-- .entry-post-content-wrap --> <?php } ?> </article><!-- #post-## --> <?php } wp_reset_postdata(); ?> </div> <?php // Pagination /* if(function_exists('wp_pagenavi')) wp_pagenavi(); else wpsp_paging_nav($post_query->max_num_pages); */ ?> <?php } else { echo esc_html__('Sorry, new content will coming soon.', 'learninginstitute'); } return ob_get_clean(); }
<?php /** * Template part for displaying staff entry title. * * @link https://codex.wordpress.org/Template_Hierarchy * * @package Learning_Institute */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } ?> <h2 id="staff-entry-title" class="entry-title staff-entry-title"> <a href="<?php wpsp_permalink(); ?> " title="<?php echo wpsp_esc_title(); ?> " rel="bookmark"><?php the_title(); ?> </a> </h2>
wpsp_permalink($page->ID); ?> " title="<?php echo wpsp_esc_title($page->ID); ?> " rel="bookmark"> <?php echo get_the_post_thumbnail($page->ID, 'thumb-landscape'); ?> </a> </div> <div class="entry-post-content-wrap"> <div class="entry-blog-content"> <h3 id="blog-entry-title" class="entry-title entry-blog-title"> <a href="<?php wpsp_permalink($page->ID); ?> " title="<?php echo wpsp_esc_title($page->ID); ?> " rel="bookmark"><span class="title"><?php echo $page->post_title; ?> </span></a> </h3> </div> <!-- .entry-blog-content --> <?php if ($post_excerpt) { ?> <div class="blog-entry-excerpt"> <?php