2012-06-06 7 views
0

사용자 정의 게시 유형과 잘 작동하는 단일 페이지 템플리트를 만들었습니다. 하지만 단일 페이지에 주석을 달 수있는 데 문제가 있습니다.WordPress 사용자 정의 게시 유형 단일 페이지 (의견)

add_action('init', 'vblog'); 
    function vblog() { 
    register_post_type('vblog', array(
    'labels' => array(
      'name' => __('VTV'), 
      'singular_name' => __('VTV'), 
      'add_new' => 'Add New VBlog', 
      'add_new_item' => 'Add New VBlog', 
      'edit' => 'Edit VBlog', 
      'edit_item' => 'Edit VBlog', 
      'new_item' => 'New VBlog', 
      'view' => 'View VBlogs', 
      'view_item' => 'View VBlog', 
      'search_iteme' => 'Search VBlogs', 
      'not_found' => 'No VBlogs Found', 
      'not_found_in_trash' => 'No VBlogs found in Trash', 
      'parent' => 'Parent VBlog', 
    ), 
    'public' => true, 
    'supports' => array('title', 'editor','custom-fields', 'thumbnail', 'revisions', 'comments'), 
    'taxonomies' => array('category', 'post_tag') 
)); 

가}

그래서 내가 지원 배열에 "의견"을 추가 한 것을 확인했다 :

내 기능입니다. 도와주세요!!!

+1

사용자 정의 포스트 유형의 단일 템플릿 댓글이 추가되었습니다 않습니다이 명령을 실행할 수 있습니다 닫은 경우이 코드 단일 vblog.php

comments_template('', true); 

를 추가 . '' – tamilsweet

답변

0

답변으로 댓글을 확장하십시오.

의견을 지원하기 위해 post_type을 올바르게 등록했습니다. 단일 {post_type} .php 템플릿에서 루프 내부의 주석 템플릿을 호출해야합니다 (endwhile와 else 사이).

if (comments_open() || '0' != get_comments_number()) 
     comments_template('', true); 
0

쇼 코멘트는 phpMyAdmin을에

UPDATE wp_posts SET comment_status = 'open' WHERE post_type = 'vblog'; 
관련 문제