특정 콘텐츠 형식에 대한 양식을 만들어 사이트 자체에서 양식을 제출할 수있는 방법이 있습니까? 내 Wordpress에서 만든 2 개의 콘텐츠 형식이 있고 특정 콘텐츠 형식으로 게시 할 양식을 만들고 싶습니다. 또한 그것은 가능한 WordPress에 페이지로 양식을 만들 수 있습니까?Wordpress에서 사용자 지정 콘텐츠 형식에 대한 사용자 지정 양식을 만드는 방법은 무엇입니까?
관련 - DJ
특정 콘텐츠 형식에 대한 양식을 만들어 사이트 자체에서 양식을 제출할 수있는 방법이 있습니까? 내 Wordpress에서 만든 2 개의 콘텐츠 형식이 있고 특정 콘텐츠 형식으로 게시 할 양식을 만들고 싶습니다. 또한 그것은 가능한 WordPress에 페이지로 양식을 만들 수 있습니까?Wordpress에서 사용자 지정 콘텐츠 형식에 대한 사용자 지정 양식을 만드는 방법은 무엇입니까?
관련 - DJ
에 읽어 :
나는 사이트의 형태를 만들 단축 코드 기능을 사용하고 있습니다. 여기에 shortcodes을 추가하는 방법에 대한 설명서가 있습니다. 제출 페이지는 또한 단축 코드가있는 '페이지'였습니다. 그래서 shortcode 함수의 값을 수집하고 wp_insert_post 함수를 사용하여 wp_posts 테이블에 내용을 추가했습니다. wp_insert_post() here에 대한 설명서를 볼 수 있습니다. 나는이 도움말 :
안부
당신은 당신의 functions.php
파일에 함수를 추가해야합니다. 다음 예와 같이 :
add_action(‘init’, ‘mycustomcontent_init’); //enable custom content types
function mycustomcontent_init() {
// create content type Crafts
$args = array(
‘label’ => __(‘Crafts’), //content type name to be displayed in the wordpress dashboard
‘singular_label’ => __(‘Crafts’), //content type name to be displayed in the wordpress dashboard
‘public’ => true,
‘show_ui’ => true, // show the user interface for this content type? true=yes false=no
‘_builtin’ => false, //declartion to the system that it’s a custom content type and not a built in content type
‘_edit_link’ => ‘post.php?post=%d’,
‘capability_type’ => ‘post’, //set the content type features, here we setting it to the features of a standard post
‘hierarchical’ => false,
‘rewrite’ => array(“slug” => “crafts”), //prefix to the url alias for this content type, eg: mysite.org/crafts/model-ships
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’)
);
register_post_type(‘crafts’ , $args);
}
here에서 가져옴.
또한, 내가 이것을 달성하기 위해 다음과 같은 방법을 사용한 Wordpress Documentation for Custom Post Types답장을 보내 주셔서 감사합니다. 그러나 이미 컨텐트 유형을 작성했으며 웹 사이트에 양식을 작성하여 특정 컨텐트 유형에 컨텐트를 게시하려고합니다. –
당신이 설명하는 '콘텐츠 유형'에 대한 우리에게 몇 가지 예를 제공시겠습니까 DJ가 희망 ... 워드 프레스에서 –
는 '게시물', '페이지'등과 같은 여러 종류가있다 Wordpress 3.0에서는 사용자 지정 콘텐츠 형식을 지원합니다. 나는 그것이 명확하게하기를 바란다! –