Display questions on the homepage

I'm looking to place the questions which typically sit on the http://www.site.com/questions page front-row-centre, in the exact same style right on the home page. Is there an (easy) way to do this? Any help/tutorial link would be great!

  • itskelowna

    Hi DavidM,

    Thank you for the response, but I had managed to solve the problem by combing code from the QA widget, and the archive-question.php right into the header.php file in my template folder.

    <!-- ITSMedia.ca Content | Place 5 Newest Questions on the Home Page -->
    <?php
    // Code from Widget
    		global $post;
    
    		$args = array();
    
    		$args = array_merge( $args, array(
    			'post_type' => 'question',
    			'posts_per_page' => 5,
    			'suppress_filters' => false
    		));
    
    		// Code from archive-question.php 
    
    		?>
    		<div id="question-list">
    		<?php
    
    		foreach ( get_posts( $args ) as $post ) {
    			setup_postdata( $post );
    
    			?>
    
    			<div class="question-home">
    		<div class="question-stats">
    			<?php the_question_score(); ?>
    			<?php the_question_status(); ?>
    		</div>
    		<div class="question-summary">
    			<h3><?php the_question_link(); ?></h3>
    			<?php the_question_tags( '<div class="question-tags">', ' ', '</div>' ); ?>
    			<div class="question-started">
    				<?php the_qa_time( get_the_ID() ); ?>
    				<?php the_qa_user_link( $post->post_author ); ?>
    			</div>
    		</div>
    	</div>
    	</div>
    			<?php
    
    		}
    
    		wp_reset_postdata();
    ?>
    
    <!-- end ITSMedia Content -->

    I hope that helps someone in the future