Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created January 8, 2016 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/6ecc8a6e083d3dc7ca45 to your computer and use it in GitHub Desktop.
Save JudeRosario/6ecc8a6e083d3dc7ca45 to your computer and use it in GitHub Desktop.
<?php
/**
* The main template file.
*
* @package Nu Themes
*/
get_header(); ?>
<div class="add-poll" id="add-poll-id">
<iframe src="http://pixelstyle.co.uk/outrankd/wp-admin/admin.php?page=wp-polls%2Fpolls-add.php"></iframe>
</div>
<div class="row" id="poll-content-wrapper">
<main id="content" class="col-md-8 col-lg-9 content-area" role="main">
<?php
$current_user = wp_get_current_user();
$friendsIdArray = friends_get_list( $current_user->ID, 1 );
//The Query
$the_query = new WP_Query( array( 'author' => implode( ",", $friendsIdArray ) ) );
// The Loop
if ( $the_query->have_posts() ) : ?>
<div id="masonry" class="row">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-xs-12 col-sm-6 col-lg-4 masonry-item">
<?php get_template_part( 'content', get_post_format() ); ?>
</div>
<?php
//Display an advert every 2 posts
$postnum++; if($postnum%2 == 0) { ?>
<div class="col-xs-12 col-sm-6 col-lg-4 masonry-item">
<article class="box post type-post status-publish format-standard hentry category-uncategorized">
<header class="entry-header">
<h2 class="entry-title">Advert Here</h2>
</header>
<hr>
<div class="clearfix entry-summary">
<p>advert content here</p>
<!-- .entry-summary --></div>
<footer class="entry-meta entry-footer">
Report this ad
</footer>
</article>
</div>
<?php } ?>
<?php endwhile; ?>
<!-- #masonry --></div>
<?php nuthemes_content_nav( 'nav-below' ); ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'index' ); ?>
<?php endif; ?>
<!-- #content --></main>
<?php //get_sidebar(); ?>
<!-- .row --></div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment