text 为Avada Portfolio创建自定义分类

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 为Avada Portfolio创建自定义分类相关的知识,希望对你有一定的参考价值。

// Create Avada Portfolio Taxonomy ******************************************
//hook into the init action and call create_book_taxonomies when it fires

add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 );
 
//create a custom taxonomy name it topics for your posts
 
function create_topics_hierarchical_taxonomy() {
 
// Add new portfolio taxonomy, make it hierarchical like categories
// First do the translations part for GUI
 
  $labels = array(
    'name' => _x( 'portfolio_client', 'taxonomy general name' ),
    'singular_name' => _x( 'Client', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Clients' ),
    'all_items' => __( 'All Clients' ),
    'parent_item' => __( 'Parent Client' ),
    'parent_item_colon' => __( 'Parent Client:' ),
    'edit_item' => __( 'Edit Client' ), 
    'update_item' => __( 'Update Client' ),
    'add_new_item' => __( 'Add New Client' ),
    'new_item_name' => __( 'New Client Name' ),
    'menu_name' => __( 'Clients' ),
  );    
 
// Now register the taxonomy
 
  register_taxonomy('portfolio_client',array('avada_portfolio'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'portfolio_client' ),
  ));
 
}

以上是关于text 为Avada Portfolio创建自定义分类的主要内容,如果未能解决你的问题,请参考以下文章

avada 可以直接用demo建站吗

Matlab -- Portfolio

Wordpress解锁主题选项

如何在 Avada 主题中插入 jQuery 代码?

居中对齐标题菜单:Wordpress(Avada 主题)自定义 CSS

WordPress/Avada 网站未在 XAMPP 中加载