wordpress如何去掉the_content的p标签

Posted in January 14, 2020 by in

把下面的一段代码添加到functions.php里面,去掉the_content的P 标签。 PHP // Remove p tags from category description remove_filter(‘term_description’,’wpautop’); 1 2 // Remove p tags from category description remove_filter(‘term_description’,’wpautop’);

wp的rest API: 用这个创建 项目, 可以利用自定义字段进行搜索

Posted in January 12, 2020 by in

创建 Json 里面的数据项目, 也就是wp的rest API: 用这个创建 项目, 可以利用自定义字段进行搜索 //Rest API function university_custom_init() { register_rest_field( ‘post’,’authorName’,array( ‘get_callback’ => function() {return get_the_author( ); } ) ); } add_action( ‘rest_api_init’, ‘university_custom_init’ );

An example of registering a two taxonomies, genres and writers, for the post type called “book”

Posted in by in

<?php // hook into the init action and call create_book_taxonomies when it fires add_action( ‘init’, ‘create_book_taxonomies’, 0 ); // create two taxonomies, genres and writers for the post type “book” function create_book_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( ‘name’ => _x( ‘Genres’, ‘taxonomy general name’, ‘textdomain’ ), ‘singular_name’ […]

WordPress升级4.3后,不能正确统计中文摘要字数的解决方法

Posted in September 7, 2019 by in

WordPress升级4.3之后,首页摘要字数统计不正确,只统计了英文而不统计中文,导致中文摘要几乎要包含到全篇的内容。 解决方法为,打开/wp-includes/formatting.php,找到 function wp_trim_words( $text, $num_words = 55,$more = null ) 中的: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /* * translators: If your word count is based on single characters (e.g. East Asian characters), * enter ‘characters_excluding_spaces’ or ‘characters_including_spaces’. Otherwise, enter ‘words’. * Do not translate into your own language. */ if ( strpos( _x( ‘words’, ‘Word […]

景祥官网关键字

Posted in September 6, 2019 by in

冷凝器,蒸发器,表冷器,翅片式换热器,翅片式散热器,翅片式冷凝器冷凝器,蒸发器,表冷器,翅片式换热器,翅片式散热器,翅片式冷凝器冷凝器,蒸发器,表冷器,翅片式换热器,翅片式散热器,翅片式冷凝器冷凝器,蒸发器,表冷器,翅片式换热器,翅片式散热器,翅片式冷凝器