WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I search for an hour now without result. Does anyone can explain me how to show my custom post_type (dictionnaire) in the homepage (index.php). I use 'Easy post type' to add custom post types and I checked the "Query Var" checkbox. Please help...

The only posts that appears in my homepage are the regular one.

share|improve this question
What exactly do you want to do? What are you using them for? You know it requires coding, right? It is "custom" for a reason :P – Miha Rekar Oct 12 '12 at 11:03

It would be something like this (goes in functions.php or elsewhere, but not template):

add_action( 'pre_get_posts', 'include_dictionnaire_in_home' );

function include_dictionnaire_in_home( $query ) {

    if ( ! is_admin() && $query->is_main_query() && $query->is_home() ) {
        $query->set( 'post_type', array( 'post', 'dictionnaire' ) );

Note that index.php template is not strictly home template. It is catch-all template that is used if no better hierarchy match is available. It's just common for home because more specific template is rarely provided for it.

share|improve this answer

Your Answer


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.