Custom type posts are missing
-
Timber does not show custom type posts in posts index page.
index.php:
$context = Timber::get_context(); $context['posts'] = Timber::get_posts(); $context['foo'] = 'bar'; $templates = array('index.twig'); if (is_home()){ array_unshift($templates, 'home.twig'); } Timber::render($templates, $context);
functions.php:
function register_post_types(){ register_post_type( 'test', array( 'labels' => array( 'name' => __( 'test' ), 'singular_name' => __( 'test' ) ), 'public' => true, 'taxonomies' => array( 'post_tag', 'category' ) ) ); }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom type posts are missing’ is closed to new replies.