Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Home Page Template
  4. *
  5. * Description: Use this page template for a page with VC plugin.
  6. *
  7. * @package WordPress
  8. * @subpackage OneSocial Theme
  9. * @since OneSocial 1.0.0
  10. */
  11. get_header();
  12. ?>
  13.  
  14. <div id="primary" class="site-content">
  15.  
  16. <div id="content" role="main">
  17.  
  18. <?php while ( have_posts() ) : the_post(); ?>
  19. <?php get_template_part( 'template-parts/content', 'page' ); ?>
  20.  
  21. <?php endwhile; // end of the loop. ?>
  22.  
  23. </div>
  24. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Home Middle") ) : ?><?php endif; ?>
  25.  
  26. <div class="mainright">
  27.  
  28.  
  29. <?php
  30.  
  31. // BETTER
  32. $query = array (
  33. 'post_type' => 'post',
  34. 'post_status' => 'publish',
  35. 'order' => 'desc',
  36. 'tag' => 'home'
  37.  
  38. );
  39.  
  40. $queryObject = new WP_Query($query);
  41. if ($queryObject->have_posts()) {
  42. while ($queryObject->have_posts()) {
  43.  
  44. echo '<article class="post entry">';
  45. echo '<a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '">'; // Original Grid
  46. echo get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'class' => 'alignright post-image entry-image' ) );
  47. echo '</a>';
  48. echo '<header class="entry-header"><h2 class="entry-title" id="hmes" itemprop="headline"><a href="' . get_permalink() . '"> ' . get_the_title() . ' </a> </h2></header>'; // show the title
  49. echo '<footer class="entry-footer">';
  50. echo 'By <span class="entry-author" itemprop="author" itemscope="itemscope" itemtype="https://schema.org/Person">';
  51. echo bp_core_get_userlink(get_the_author_meta('ID'));
  52. echo '</span>';
  53. echo '<p class="timeb">';
  54.  
  55. echo '<i class="icon-bookmark"></i>';
  56.  
  57. echo '</p>';
  58.  
  59. echo '</footer></article>';
  60. }
  61. }
  62.  
  63.  
  64. ?>
  65.  
  66.  
  67.  
  68. </div>
  69. </div>
  70.  
  71. <?php
  72. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement