Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.