Hey Rad,
I haven’t implemented any code yet. If you take a look at https://recyclingdev.wpengine.com/news/, you’ll see what I’m trying to. Currently, it’s duct taped together with CSS (absolute positioning the Sidebar, lol) but would like to make it viable.
My thinking was that I could do something like:
<?php
// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================
$stack = x_get_stack();
if ( is_home() ) :
$style = x_get_option( 'x_blog_style' );
$cols = x_get_option( 'x_blog_masonry_columns' );
$condition = is_home() && $style == 'masonry';
elseif ( is_archive() ) :
$style = x_get_option( 'x_archive_style' );
$cols = x_get_option( 'x_archive_masonry_columns' );
$condition = is_archive() && $style == 'masonry';
elseif ( is_search() ) :
$condition = false;
endif;
?>
<?php if ( $condition ) : ?>
<?php x_get_view( 'global', '_script', 'isotope-index' ); ?>
<div id="sticky-post-container">
<?php $sticky = get_option( 'sticky_posts' );
if(!empty($sticky)){
$args = array(
'posts_per_page' => -1, //get all post
'post__in' => $sticky, //are they sticky post
);
// The Query
$the_query = new WP_Query( $args );
// The Loop //we are only getting a list of the title as a li see the loop docs for details on the loop or copy this from index.php (or posts.php)
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo "title featured excerpt etc.";
}
wp_reset_query(); //reset the original WP_Query
}
?>
</div>
<div id="x-iso-container" class="x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( $stack != 'ethos' ) : ?>
<?php x_get_view( $stack, 'content', get_post_format() ); ?>
<?php else : ?>
<?php x_ethos_entry_cover( 'main-content' ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
</div>
<?php else : ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( $stack, 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
<?php endif; ?>
<?php pagenavi(); ?>
But maybe there’s an easier way/place to implement this? I will just need this on the News page.
Thanks!