我们需要把$product->get_type(); 修改为:$product->product_type;https://docs.woocommerce.com/wc-apidocs/class-WC_Product.html#_get_type……继续阅读 » qushang 1年前 (2019-12-22) 198浏览 0评论0个赞
使用分页器制作分类列表<?php$args = array ( 'showposts' => '2', 'category_name' => 'case', 'paged' => $paged);$the_query = new WP_Query( $args );?><?php if……继续阅读 » qushang 3年前 (2018-07-17) 278浏览 0个赞
function new_subcategory_hierarchy() { $category = get_queried_object(); $parent_id = $category->category_parent; $templates = array(); if ( $parent_id == 0 ) {……继续阅读 » qushang 3年前 (2018-07-09) 270浏览 0个赞
为创建独立ID或别名的样式文件category-news.php,或者category-(新闻id).php。WordPress默认的分类是优先查找对应ID的主题文件,找不到就会指向archive.php文件,如果archive.php文件不存在,就会默认使用index.php文件。到后台查看一下要设计样式的分类的ID,假设分类ID为7,之后把主题文件arc……继续阅读 » qushang 3年前 (2018-07-09) 272浏览 0个赞
使用wp_trim_words()截取function customTitle($limit) { $title = get_the_title($post->ID); if(strlen($title) > $limit) { $title = substr($title, 0, $limit) . '...'……继续阅读 » qushang 3年前 (2018-07-09) 284浏览 0个赞
underscoresHomehttps://github.com/Automattic/_s样板插件https://github.com/DevinVinson/WordPress-Plugin-Boilerplatehttp://wppb.io/wordpress vagrant 开发环境https://github.com/Varyin……继续阅读 » qushang 3年前 (2018-07-09) 308浏览 0个赞
添加Favicon 图标add_action( 'wp_head', 'wpfi_page_header_output' );function wpfi_page_header_output() { $site_icon_url = get_site_icon_url(); if ( !empty( $site_icon_url ) ) { wp……继续阅读 » qushang 3年前 (2018-02-25) 280浏览 0个赞
wp2.8数据表(10)表名描述WordPress用户界面相关区域wp_commentsWordPress中的评论 存储在wp_comments表中评论是由读者创建的作为对文章的回应。评论由管理员管理,通过管理 > 评论 > 评论wp_linkswp_links 保存包含在WordPress Linksfeat……继续阅读 » qushang 3年前 (2018-02-25) 296浏览 0个赞
插件生成工具https://wppb.me/http://wppb.io/https://github.com/WebDevStudios/generator-plugin-wp文档参考数据库https://codex.wordpress.org/zh-cn:%E6%95%B0%E6%8D%AE%E5%BA%93%E6%8F%8F%E8……继续阅读 » qushang 3年前 (2018-02-25) 274浏览 0个赞
https://codex.wordpress.org/Function_Reference/register_post_type使用方法<?php register_post_type( $post_type, $args ); ?>假设我们注册一个产品的类型<?php// Register Custom Post Types……继续阅读 » qushang 3年前 (2017-12-14) 270浏览 0个赞