我是wordpress的新手,所以对于这个基本问题,我很抱歉。我如何有一个案例研究页面,但链接3个案例研究在我的主页上显示一个简短的版本。
有什么想法吗?
谢谢!史考特
发布于 2018-09-17 23:23:10
我将从创建一个名为case Custom Post Type的案例研究开始。将以下内容添加到主题(或子主题)的function.php中。
// Create Custom Post Type
function my_custom_posttype(){
register_post_type('case studies',
// Options
array(
'labels' => array(
'name' => __('Case Studies'),
'singular_name' => __('Case Study')
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'case-studies'),
)
);
}
add_action( 'init', 'my_custom_posttype' );这将在管理中添加一个新链接,以添加新的案例研究,就像帖子和页面一样。这是一个非常基本的例子,查看上面的链接了解更多关于帖子类型的信息。
将它们添加到主页将取决于您使用的主题。
https://stackoverflow.com/questions/52370850
复制相似问题