Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #993478

    Hello,
    On the Admin Dashboard, I tried re-labelling “Portfolio Categories” to “Connection Categories”. Inserted the suggested codes in thread #566053.

    https://kriesi.at/support/topic/renaming-the-portfolio-custom-post-type-child-theme-issues/?login_error.

    Didn’t work. Below is the error.

    The code snippet you are trying to save produced a fatal error on line 6:
    Cannot redeclare unregister_taxonomy() (previously declared in /home/health232/public_html/wp-includes/taxonomy.php:418)

    Any suggestion to resolve the issue is appreciated.

    Thanks,

    Nik

    #993692

    Hey Nik,

    Please try this code:

    
    function avia_unregister_taxonomy(){
    	global $wp_taxonomies;
    	$taxonomy = 'portfolio_entries';
    	if ( taxonomy_exists( $taxonomy))
    		unset( $wp_taxonomies[$taxonomy]);
    }
    add_action( 'init', 'avia_unregister_taxonomy', 30);
    
    // portfolio args
    add_action( 'init', 'init_reg_portfolio', 50 );
    function init_reg_portfolio() {
    	add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod', 50, 1);
    
    	$tax_args = array(
    		"hierarchical" => true,
    		"label" => "Hall of Fame Categories",
    		"singular_label" => "Hall of Fame Category",
    		"rewrite" => array('slug'=>_x($permalinks['portfolio_entries_taxonomy_base'],'URL slug','avia_framework'), 'with_front'=>true),
    		"query_var" => true
    	);
    
    	$avia_config['custom_taxonomy']['portfolio']['portfolio_entries']['args'] = $tax_args;
    
    	register_taxonomy("portfolio_entries", array("portfolio"), $tax_args);
    }
    
    add_action( 'after_setup_theme', 'init_reg_portfolio' );
    
    function avf_portfolio_cpt_args_mod($args) {
    	$labels = array(
    		'name' => _x('Hall of Fame', 'post type general name','avia_framework'),
    		'singular_name' => _x('Hall of Fame Entry', 'post type singular name','avia_framework'),
    		'add_new' => _x('Add New', 'portfolio','avia_framework'),
    		'add_new_item' => __('Add New Portfolio Entry','avia_framework'),
    		'edit_item' => __('Edit Portfolio Entry','avia_framework'),
    		'new_item' => __('New Portfolio Entry','avia_framework'),
    		'view_item' => __('View Portfolio Entry','avia_framework'),
    		'search_items' => __('Search Portfolio Entries','avia_framework'),
    		'not_found' =>  __('No Portfolio Entries found','avia_framework'),
    		'not_found_in_trash' => __('No Portfolio Entries found in Trash','avia_framework'),
    		'parent_item_colon' => ''
    	);
    
    	$args['labels'] = $labels;
    	return $args;
    }
    

    and replace:

    
    'name' => _x('Hall of Fame', 'post type general name','avia_framework'),
    'singular_name' => _x('Hall of Fame Entry', 'post type singular name','avia_framework'),
    

    with your custom text. To change the url slugs go to Settings > Permalinks and enter custom slugs into the “Portfolio Items Base” and “Portfolio Categories Base” setting fields. However be careful – you must not use slugs which are already used by posts or pages.

    Best regards,
    Dude

    #1013127

    Hey Dude,

    Thanks so much for the code. It worked.

    Nik

    #1013138

    Hi,

    Great, glad I could help you :)

    Best regards,
    Peter

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Re-name "Portfolio Categories"’ is closed to new replies.