<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom Post Type: modificare lo slug]]></title><description><![CDATA[<p dir="auto">Salve a tutti,<br />
sto utilizzando il theme free <a href="http://www.wpexplorer.com/adapt-free-responsive-wordpress-theme/" rel="nofollow ugc">Adapt theme</a>.</p>
<p dir="auto">Vorrei modificare lo SLUG di un Custom Post Type esistente nel theme:</p>
<pre><code>function portfolio_init() {


			/**
			 * Enable the Portfolio custom post type
			 * http://codex.wordpress.org/Function_Reference/register_post_type
			 */


			$labels = array(
				'name'					=&gt; __( 'Prodotti', 'wpex' ),
				'singular_name'			=&gt; __( 'Prodotti Item', 'wpex' ),
				'add_new'				=&gt; __( 'Aggiungi nuovo prodotto', 'wpex' ),
				'add_new_item'			=&gt; __( 'Add New Portfolio Item', 'wpex' ),
				'edit_item'				=&gt; __( 'Modifica prodotto', 'wpex' ),
				'new_item'				=&gt; __( 'Add New Portfolio Item', 'wpex' ),
				'view_item'				=&gt; __( 'Vedi Prodotto', 'wpex' ),
				'search_items'			=&gt; __( 'Search Prodotto', 'wpex' ),
				'not_found'				=&gt; __( 'No portfolio items found', 'wpex' ),
				'not_found_in_trash'	=&gt; __( 'No portfolio items found in trash', 'wpex' )
			);
			
			$args = array(
				'labels'			=&gt; $labels,
				'public'			=&gt; true,
				'supports'			=&gt; array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions', 'post-formats' ),
				'capability_type'	=&gt; 'post',
				'rewrite'			=&gt; array("slug" =&gt; "portfolio-item"), // Permalinks format
				'has_archive'		=&gt; false,
				'menu_icon'			=&gt; 'dashicons-hammer',
			); 
			
			$args = apply_filters( 'wpex_portfolio_args', $args);
			
			register_post_type( 'portfolio', $args );
</code></pre>
<p dir="auto">Ho provato a</p>
<ol>
<li>modificarlo, ma niente</li>
<li>modificarlo, aggiornare i permalink, niente, rimane quello originale</li>
</ol>
<p dir="auto">Suggerimenti?</p>
<p dir="auto">Grazie.</p>
]]></description><link>https://dev.connect.gt/topic/209098/custom-post-type-modificare-lo-slug</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 02:42:05 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/209098.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Dec 2014 22:27:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom Post Type: modificare lo slug on Wed, 17 Dec 2014 08:52:34 GMT]]></title><description><![CDATA[<p dir="auto">No, proverò a disattivarlo ed attivarlo nuovamente, vediamo cosa succede...</p>
<p dir="auto">Lato frontend non dovrei modificare nulla, giusto?</p>
<pre><code>                            &lt;?php
                            // Setup tax query if needed
                            if ( wpex_get_data('home_port_cat') !== '' &amp;&amp; wpex_get_data('home_port_cat') !== 'All' ) {
                                $wpex_tax_query = array(
                                    array (
                                        'taxonomy'	=&gt; 'portfolio_category',
                                        'field' 	=&gt; 'slug',
                                        'terms'		=&gt; wpex_get_data( 'home_port_cat' )
                                    )
                                );
                            } else { $wpex_tax_query = NULL; } ?&gt;
                            
                            &lt;?php $wpex_port_query = new WP_Query(
                                array(
                                    'post_type' =&gt; 'portfolio',
                                    'showposts' =&gt; wpex_get_data( 'home_port_count', '4' ),
                                    'no_found_rows' =&gt; true,
                                    'tax_query' =&gt; $wpex_tax_query
                                )
                            );
                            
                            if( $wpex_port_query-&gt;posts ) { ?&gt;
                                &lt;section id="home-projects" class="clearfix"&gt;
                                	&lt;?php if ( wpex_get_data( 'home_port_heading', '1' ) == '1' ) { ?&gt;
                            			&lt;h2 class="heading"&gt;&lt;span&gt;&lt;?php echo wpex_get_data('home_port_heading_txt', __( 'Recent Work', 'wpex' ) ); ?&gt;&lt;/span&gt;&lt;/h2&gt;
                                	&lt;?php } ?&gt;
									&lt;?php $wpex_count=0; ?&gt;
                                    &lt;?php foreach( $wpex_port_query-&gt;posts as $post ) : setup_postdata( $post ); ?&gt;
										&lt;?php $wpex_count++; ?&gt;
                                        &lt;?php get_template_part( 'content', 'portfolio' ); ?&gt;
                                        &lt;?php if( $wpex_count == '4' ) $wpex_count=0; ?&gt;
                                    &lt;?php endforeach; ?&gt;
                                &lt;/section&gt;&lt;!-- /home-projects --&gt;
                            &lt;?php } ?&gt;
</code></pre>
]]></description><link>https://dev.connect.gt/post/1182310</link><guid isPermaLink="true">https://dev.connect.gt/post/1182310</guid><dc:creator><![CDATA[felino]]></dc:creator><pubDate>Wed, 17 Dec 2014 08:52:34 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Post Type: modificare lo slug on Tue, 16 Dec 2014 17:40:55 GMT]]></title><description><![CDATA[<p dir="auto">Vedendo il codice è tutto giusto.<br />
Banalmente; hai provato a disattivare il template e riattivarlo?</p>
<p dir="auto">Comunque questa è la funzione completa ( rubata da i codex i wordpress ovviamente )</p>
<pre><code>function codex_book_init() {
	$labels = array(
		'name'               =&gt; _x( 'Books', 'post type general name', 'your-plugin-textdomain' ),
		'singular_name'      =&gt; _x( 'Book', 'post type singular name', 'your-plugin-textdomain' ),
		'menu_name'          =&gt; _x( 'Books', 'admin menu', 'your-plugin-textdomain' ),
		'name_admin_bar'     =&gt; _x( 'Book', 'add new on admin bar', 'your-plugin-textdomain' ),
		'add_new'            =&gt; _x( 'Add New', 'book', 'your-plugin-textdomain' ),
		'add_new_item'       =&gt; __( 'Add New Book', 'your-plugin-textdomain' ),
		'new_item'           =&gt; __( 'New Book', 'your-plugin-textdomain' ),
		'edit_item'          =&gt; __( 'Edit Book', 'your-plugin-textdomain' ),
		'view_item'          =&gt; __( 'View Book', 'your-plugin-textdomain' ),
		'all_items'          =&gt; __( 'All Books', 'your-plugin-textdomain' ),
		'search_items'       =&gt; __( 'Search Books', 'your-plugin-textdomain' ),
		'parent_item_colon'  =&gt; __( 'Parent Books:', 'your-plugin-textdomain' ),
		'not_found'          =&gt; __( 'No books found.', 'your-plugin-textdomain' ),
		'not_found_in_trash' =&gt; __( 'No books found in Trash.', 'your-plugin-textdomain' )
	);

	$args = array(
		'labels'             =&gt; $labels,
		'public'             =&gt; true,
		'publicly_queryable' =&gt; true,
		'show_ui'            =&gt; true,
		'show_in_menu'       =&gt; true,
		'query_var'          =&gt; true,
		'rewrite'            =&gt; array( 'slug' =&gt; 'book' ),
		'capability_type'    =&gt; 'post',
		'has_archive'        =&gt; true,
		'hierarchical'       =&gt; false,
		'menu_position'      =&gt; null,
		'supports'           =&gt; array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
	);

	register_post_type( 'book', $args );
}
</code></pre>
]]></description><link>https://dev.connect.gt/post/1182306</link><guid isPermaLink="true">https://dev.connect.gt/post/1182306</guid><dc:creator><![CDATA[ultima]]></dc:creator><pubDate>Tue, 16 Dec 2014 17:40:55 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Post Type: modificare lo slug on Tue, 16 Dec 2014 13:27:12 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Stefano,<br />
la modifica la sto apportando direttamente sul theme originale, anche se è attivo il child.</p>
<p dir="auto">Suggerimenti?</p>
<p dir="auto">Grazie.</p>
]]></description><link>https://dev.connect.gt/post/1182307</link><guid isPermaLink="true">https://dev.connect.gt/post/1182307</guid><dc:creator><![CDATA[felino]]></dc:creator><pubDate>Tue, 16 Dec 2014 13:27:12 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Post Type: modificare lo slug on Tue, 16 Dec 2014 12:05:55 GMT]]></title><description><![CDATA[<p dir="auto">Ma questa operazione la stai facendo sul tema originale o su una sua versione child?</p>
]]></description><link>https://dev.connect.gt/post/1182302</link><guid isPermaLink="true">https://dev.connect.gt/post/1182302</guid><dc:creator><![CDATA[ultima]]></dc:creator><pubDate>Tue, 16 Dec 2014 12:05:55 GMT</pubDate></item></channel></rss>