• Resolved MekZii

    (@mekzii)


    I use the fallowing piece of code in my index.php:

    <?php get_template_part('content', get_post_format()); ?>

    I have a custom post type called ‘quote’ who has it’s own 2 pages:
    content-quote.php
    and
    single-quote.php

    The problem now is that the get_post_format() returns ‘false’ wish means ‘standard’. I expect it to be ‘quote’. Why is this happening?

    I have changed the main loop with the fallowing code to add ‘quote’ type:

    if (!function_exists('wpf_main_query')) {
    	function wpf_main_query($query) {
    		if (is_home() and $query->is_main_query() or is_feed())
    			$query->set('post_type', array('post', 'quote'));
    
    		return $query;
    	}
    }
    add_filter('pre_get_posts', 'wpf_main_query');

    I got a second question:
    Do I need to add this:

    add_theme_support('post-formats', array('quote'));

    When I use the register_post_type() to register my ‘quote’-posttype?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom post type is seen as 'standard'’ is closed to new replies.