Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to use a post as the front page?

I'd like to be able to call the latest post from a given custom post type, in a certain custom taxonomy and with a specific term and use this as the front page - similar to using a page as the front page, but using a post instead (showing comments, trackback, etc. too)?

share|improve this question

1 Answer 1

up vote 1 down vote accepted
  1. You just need to modify the main query:

    // inside functions.php
    function wpse47667_intercept_main_query( $wp )
    {
        // Modify the main query object
        $wp->query_vars['custom_tax_name'] = 'custom_term_slug';
    
        return $wp;
    }
    add_filter( 'parse_request', 'wpse47667_intercept_main_query' );
    
  2. Then you have to replace the_excerpt() with the_content() inside your index.php/home.php/front-page.php template file, to show the full post instead of the excerpt.
share|improve this answer
    
Brilliant! Thanks Kaiser! –  Rob Apr 3 '12 at 15:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.