Read More
<?php if ( have_posts() ) : if ( is_home() && ! is_front_page() ) : ?> <header> <h1 class="page-title screen-reader-text"><? .....
Read MoreWP在注册custom taxonomy的时候添加default_term就好了。 function abt_register_taxonomy() { //this code is $args = array( 'labels' => array( 'name' .....
Read MorePHP的class名称都是以驼峰形式或者双峰形式的,第一个字母可以大写也可以小写但是第二个字母一定要大写,或者可以以下划线的形式。 Class由构造函数:_con .....
Read Morewordpress高级主题文件基本结构:admin面板类、自定义Blocks类、自定义函数类、自定义loop类、自定义片段parts类、plugins导入类、短代码类、自定义小工具 .....
Read More涉及函数:add_image_size() 、 get_option() 、attachment_url_to_postid() 、wp_get_attachment_image() 、 wp_get_attachment_image_url(). 首先在 .....
Read More当你创建如archive-posttyps.php 之类的自定义文章类型的archive的时候,你要调用这个文章分类的内容,你就无需用自定义的wp_query, 默认的query已经随着 .....
Read Moreget_page_by_title( ‘about’ );get_page_by_path(‘workflow’); get_page_by_title是通过页面的title来获取到页面的wp_post对象(object),获取到id,post_ .....
Read More在注册的时候添加default_term就好了。 function abt_register_taxonomy() { $args = array( 'labels' => array( 'name' => 'Product Categories', .....
Read MoreLorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi elementum aliquam lobortis. Orci varius natoque penatibus et magnis dis parturien .....
Read More