Home › Forum › Problemi Vari con WP › Custom Post Type: modificare lo slug
-
AutorePost
-
-
15 Dicembre 2014 alle 22:15 #28589robertinoPartecipante
Salve a tutti,
sto utilizzando il theme free Adapt theme.
Vorrei modificare lo SLUG di un Custom Post Type esistente nel theme:
function portfolio_init() {
/**
* Enable the Portfolio custom post type
* http://codex.wordpress.org/Function_Reference/register_post_type
*/
$labels = array(
'name' => __( 'Prodotti', 'wpex' ),
'singular_name' => __( 'Prodotti Item', 'wpex' ),
'add_new' => __( 'Aggiungi nuovo prodotto', 'wpex' ),
'add_new_item' => __( 'Add New Portfolio Item', 'wpex' ),
'edit_item' => __( 'Modifica prodotto', 'wpex' ),
'new_item' => __( 'Add New Portfolio Item', 'wpex' ),
'view_item' => __( 'Vedi Prodotto', 'wpex' ),
'search_items' => __( 'Search Prodotto', 'wpex' ),
'not_found' => __( 'No portfolio items found', 'wpex' ),
'not_found_in_trash' => __( 'No portfolio items found in trash', 'wpex' )
);
$args = array(
'labels' => $labels,
'public' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'post-formats' ),
'capability_type' => 'post',
'rewrite' => array("slug" => "portfolio-item"), // Permalinks format
'has_archive' => false,
'menu_icon' => 'dashicons-hammer',
);
$args = apply_filters( 'wpex_portfolio_args', $args);
register_post_type( 'portfolio', $args );
Ho provato a
1) modificarlo, ma niente
2) modificarlo, aggiornare i permalink, niente, rimane quello originale
Suggerimenti?
Grazie.
-
16 Dicembre 2014 alle 6:45 #115115SteveAglAmministratore del forum
Forse perchè basta cambiarlo in:
register_post_type( ‘portfolio’, $args );
-
16 Dicembre 2014 alle 9:52 #115119robertinoPartecipante
Forse perchè basta cambiarlo in:
register_post_type( ‘portfolio’, $args );
In che senso?
L’attuale slug è ‘portfolio-item’ ed io vorrei convertirlo in ‘prodotti’.
-
16 Dicembre 2014 alle 13:28 #115125SteveAglAmministratore del forum
oppp si scusa:
‘rewrite’ => array(“slug” => “portfolio-item”), // Permalinks format
qui hai lo slug
-
16 Dicembre 2014 alle 13:48 #115127robertinoPartecipante
Esatto, ho modificato lo SLUG cosà¬:
$args = array(
'labels' => $labels,
'public' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'post-formats' ),
'capability_type' => 'post',
'rewrite' => array("slug" => "prodotti"), // Permalinks format
'has_archive' => false,
'menu_icon' => 'dashicons-hammer',
);
ma la modifica non avviene, come mai?
-
16 Dicembre 2014 alle 14:44 #115131SteveAglAmministratore del forum
ricrea i permalink cos’ da fargli ricreare le rewrite interne a WP
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.