function blog($atts, $content = null) { extract(shortcode_atts(array("class" => ''), $atts)); global $post; $return = '<div id="main-blog-holder"><div id="blog-items-holder">'; $conuter = 0; $postsperpage = get_option('posts_per_page'); $page = get_query_var('paged') ? get_query_var('paged') : 1; query_posts('post_type=post&paged=' . $page); while (have_posts()) { the_post(); $conuter++; if ($conuter % 2 == 1) { $return .= '<div class="bottom-10 one_half_with_border text-left"> <p class="blog-section-title crete-round-font bottom-10"><a href="' . get_permalink($post->ID) . '">' . substrwords(get_the_title(), 70) . '</a></p> <p class="blog-date-holder bottom-20">' . get_the_date('d-M') . ' / ' . drop_cats($post->ID) . '' . get_comments_number('0') . ' COMMENTS</p> <p class="blog-excerpt-holder"> ' . get_the_excerpt() . ' </p> <a class="button dark" href="' . get_permalink($post->ID) . '">READ MORE</a> </div>'; } else { $return .= '<div class="bottom-10 one_half_with_border last border-left text-left"> <p class="blog-section-title crete-round-font bottom-10"><a href="' . get_permalink($post->ID) . '">' . substrwords(get_the_title(), 70) . '</a></p> <p class="blog-date-holder bottom-20">' . get_the_date('d-M') . ' / ' . drop_cats($post->ID) . '' . get_comments_number('0') . ' COMMENTS</p> <p class="blog-excerpt-holder"> ' . get_the_excerpt() . ' </p> <a class="button dark" href="' . get_permalink($post->ID) . '">READ MORE</a> </div>'; if ($conuter / $postsperpage != 1) { $return .= '<div class="clear separator blank_separator"></div>'; } } } $return .= '<div class="clear"></div> <div id="blog-pagination" class="navigation-holder"> <span class="navigation-next crete-round-font">' . get_previous_posts_link('<span class="left next-blog-pagination">Next</span>') . '</span><span class="navigation-previous crete-round-font">' . get_next_posts_link('<span class="right previus-blog-pagination">Previous</span>') . '</span><div class="clear"></div></div> </div></div>'; wp_reset_query(); return $return; }
<section class="left-rail"> <div class="inner"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <article class="post"> <h2><?php the_title(); ?> </h2> <div class="post archive wrap"> <h2>Posts by Category</h2> <?php drop_cats(); ?> <h2>Posts by Tag</h2> <?php drop_tags(); ?> <h2 class="date">Posts By Date</h2> </div> <div style="clear: both;"></div> <?php the_content(); ?> </article> <?php }
" <?php post_class('section'); ?> style="background-color:<?php echo $page_background_color; ?> " > <?php } echo '<div class="block content-960 center-relative"> '; if (get_post_meta($post->ID, "post_above_title", true) != '') { $above_title = get_post_meta($post->ID, "post_above_title", true); echo do_shortcode($above_title); } echo '<div class="single-title crete-round-font bottom-30 top-50"><h3 class="single-title" style="color: ' . $page_title_color . '">' . get_the_title() . '</h3></div> <p class="blog-date-holder bottom-30 center-text" style="color: ' . $page_date_color . '">' . get_the_date('d-M') . ' / ' . drop_cats($post->ID) . '' . get_comments_number('0') . ' COMMENTS</p> '; if (has_post_thumbnail($post->ID)) { $portfolio_post_thumb = get_the_post_thumbnail(); echo '<div class="post-thumb-holder center-text bottom-30">' . $portfolio_post_thumb . '</div>'; } the_content(); echo '<div class="clear"></div>'; wp_link_pages(); echo '<div class="clear bottom-50"></div>'; $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { echo $tag->name . ' '; } }