function vntd_blog($atts, $content = null) { extract(shortcode_atts(array("cats" => '', "blog_style" => 'classic', "grid_cols" => '3', "grid_style" => 'boxed', "style_meta" => 'classic', "grid_masonry" => 'yes', "ajax" => 'no', "posts_nr" => '', "el_position" => '', "width" => ''), $atts)); // Get Blog Style $blog_grid_style = ''; if ($blog_style == "grid" || $blog_style == "timeline") { wp_enqueue_script('vntdIsotope', '', '', '', true); } global $post; $layout = get_post_meta($post->ID, 'page_layout', true); if ($layout != "fullwidth") { $sidebar_class = "page-sidebar"; } // Define grid item size ob_start(); echo '<div class="blog blog-index blog-style-' . esc_attr($blog_style) . '">'; // The Loop wp_reset_query(); global $more; $more = 0; // Reset the More Tage echo '<div class="blog-inner blog-style-' . $grid_style . '">'; if ($blog_style == "grid" || $blog_style == "timeline") { if ($blog_style == "timeline") { $grid_cols = 2; } echo '<div class="vntd-grid-container grid-cols-' . esc_attr($grid_cols) . ' blog-meta-' . esc_attr($style_meta) . ' grid-style-' . esc_attr($grid_style) . '" data-cols="' . esc_attr($grid_cols) . '">'; } wp_reset_postdata(); $paged = waxom_query_pagination(); $args = array('posts_per_page' => $posts_nr, 'cat' => $cats, 'orderby' => 'slug', 'paged' => $paged); $the_query = new WP_Query($args); if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); waxom_blog_post_content($layout, $blog_style, $grid_style, $grid_masonry); } } // Loop END if ($blog_style == "grid" || $blog_style == "timeline") { echo "</div>"; } waxom_pagination($the_query); // Pagination if ($ajax == 'yes') { waxom_ajax_pagination($the_query, "blog"); } wp_reset_query(); echo '</div></div>'; $content = ob_get_contents(); ob_end_clean(); return $content; }
<?php if ($layout != "fullwidth") { echo '<div class="page_inner">'; } echo '<div class="blog-inner blog-style-' . esc_attr($grid_style) . '">'; if ($blog_style == "grid" || $blog_style == "timeline") { $grid_cols = waxom_option('blog_grid_cols'); if ($blog_style == "timeline") { $grid_cols = 2; } echo '<div class="vntd-grid-container grid-cols-' . esc_attr($grid_cols) . ' grid-style-' . esc_attr($grid_style) . '" data-cols="' . esc_attr($grid_cols) . '">'; } if (have_posts()) { while (have_posts()) { the_post(); waxom_blog_post_content($layout, $blog_style); // Layout, Style, Grid Style, Masonry } // Archive doesn't exist: } else { esc_html_e('Nothing found, sorry.', 'waxom'); } if ($blog_style == "grid" || $blog_style == "timeline") { echo "</div>"; } waxom_pagination(); echo '</div>'; if ($layout != "fullwidth") { echo '</div>'; get_sidebar(); }
<div class="single-post post blog page-holder page-layout-<?php echo esc_attr($layout); ?> "> <?php if ($page_width != 'fullwidth') { echo '<div class="inner clearfix">'; } if ($layout != "fullwidth") { echo '<div class="page_inner">'; } if (have_posts()) { while (have_posts()) { the_post(); waxom_blog_post_content($layout); if (get_trackback_url()) { echo '<p>Trackback URL: <a href="' . get_trackback_url() . '">' . get_trackback_url() . '</a></p>'; } wp_link_pages(); waxom_blog_post_tags(); waxom_blog_post_author(); } } if (comments_open()) { comments_template(); } // Load comments if enabled if ($layout != "fullwidth") { echo '</div>'; get_sidebar();