How to make custom front page section for sticky post? (1 post)

  1. laureninspace
    Posted 1 year ago #

    I'm customizing the bresponzive theme to replace the slider widget with a single sticky post. I've gotten it to echo back correctly, but for some reason, stickies are showing up only in the "recent posts" section.

    I suspect that I didn't correctly modify the loop to correspond with my sticky post code. Do you see an error in my main index template code?

    <?php get_header(); ?>
    <div id="blocks-wrapper" class="clearfix">
    	<div id="blocks-left" class="eleven columns clearfix">
    		if(isset($bresponZive_tpcrn_data['offline_feat_slide'])) { if($bresponZive_tpcrn_data['offline_feat_slide'] =='1')  include_once('includes/flex-slider.php'); }?>
    $sticky = get_option('sticky_posts');
    $not_in = array();
    if ( $sticky ) {
       $args = array(
          'posts_per_page' => 1,
          'ignore_sticky_posts' => 1,
          'post__in' => $sticky,
       $sticky_posts = get_posts($args);
       if ($sticky_posts) {
          foreach ($sticky_posts as $post) {
             $not_in[] = $post->ID;
             echo "<h2>Sticky Post</h2><p>$post->ID ";the_title();echo '</p>';
    wp_reset_postdata(); ?>
    <h2 class="blogpost-wrapper-title"><?php _e('Recent Posts','bresponZive');?> </h2>
    			<?php   get_template_part( 'includes/blog', 'loop' );?>
    <!--homepage content-->
     							<?php dynamic_sidebar('Magazine Style Widgets)'); ?>
     			<!-- /blocks col -->
     <?php get_sidebar();  ?>
     <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic