Home › Forums › Agent Focused Theme › Rename Communities › Reply To: Rename Communities
August 8, 2018 at 2:04 pm #9179
Keymaster
You can rename the communities by adding some code to the end of your functions.php file.
Please make a backup before you edit this file.
Also I have changed the “communities” to “estates”, so you will need to edit the word “estate” to the word you want to use. Only edit the words “Estate”, “Estates”, or estate, do NOT edit anything else.
// Change the Communities Types to Estate Types.
add_action( 'init', 'af_change_community_post_taxonomy' );
function af_change_community_post_taxonomy() {
// Register Estate Type Taxonomy taxonomy for the Estate custom post type.
register_taxonomy( 'wap-community-type', 'wap-community',
array(
'labels' => array(
'name' => _x( 'Estate Type', 'taxonomy general name', 'agentfocused' ),
'add_new_item' => __( 'Add New Estate Type', 'agentfocused' ),
'new_item_name' => __( 'New Estate Type', 'agentfocused' ),
),
'exclude_from_search' => true,
'has_archive' => true,
'hierarchical' => true,
'rewrite' => array( 'slug' => 'estate/type', 'with_front' => false ),
'show_ui' => true,
'show_admin_column' => true,
'show_tagcloud' => true,
)
);
}
// Change the Communities to Estates.
add_action( 'init', 'af_change_community_post' );
function af_change_community_post() {
// Register Estates custom post type.
register_post_type( 'wap-community',
array(
'labels' => array(
'name' => __( 'Estates', 'agentfocused' ),
'singular_name' => __( 'Estate', 'agentfocused' ),
'all_items' => __( 'All Estates', 'agentfocused' ),
'add_new_item' => __( 'Add New Estate', 'agentfocused' ),
'add_new' => __( 'Add New', 'agentfocused' ),
'edit_item' => __( 'Edit Estate', 'agentfocused' ),
),
'has_archive' => true,
'hierarchical' => true,
'menu_icon' => 'dashicons-admin-home',
'public' => true,
'rewrite' => array( 'slug' => 'estates', 'with_front' => false ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-layouts', 'genesis-cpt-archives-settings' ),
'taxonomies' => array( 'wap-community-type' ),
)
);
}