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
    • New Recruit

    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 -->
    // 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">
    		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 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 ); ?>
    <!-- end ITSMedia Content -->

    I hope that helps someone in the future :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.