wordpress自定义文章类型功能添加-WordPress主题

摘要:我们在做wordpress企业站的时候常常需要增加自定义文章类型 类似于产品中心,案例中心,新闻资讯 不同分类需要调用不…

我们在做wordpress企业站的时候常常需要增加自定义文章类型

类似于产品中心,案例中心,新闻资讯

不同分类需要调用不同的模板,所以我们可以通过自定义文章类型来定义

下面以添加产品中心来举例:

1.在主题函数functions.php中添加一下代码

2.增加wordpress自定义文章的分类功能

wordpress自定义文章类型的调用方法,只需要新增分类页archive-product.php 和文章页single-product.php
如果要在模板页面调用自定义文章类型的分类文章列表就需要用到以下代码;

来源:http://www.wazhuti.com/716.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_13150.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?