WordPress.org

Support

Support » How-To and Troubleshooting » Removing 'portfolio-view' from url – almost what is missing from code?

Removing 'portfolio-view' from url – almost what is missing from code?

  • I am trying to remove portfolio view from url and followed instructions to remove its name from highlighted section. This works but has left me with ‘portfolio’ now even though field is blank. what is wrong with this code or need changing in breadcrumbs please?
    trying to get:
    http://www.sitename.com/post
    currently have: http//www.sitename.com/portfolio/post

    /* Portfolio */
    function my_post_type_portfolio() {
    	register_post_type( 'portfolio',
                    array(
    				'label' => __('Portfolio'),
    				'singular_label' => __('Porfolio Item', 'theme'),
    				'_builtin' => false,
    				'public' => true,
    				'show_ui' => true,
    				'show_in_nav_menus' => true,
    				'capability_type' => 'page',
    				'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png',
    				<strong>'rewrite' => array(
    					'slug' => '',
    					'with_front' =>false,</strong>
    				),
    				'supports' => array(
    						'title',
    						'editor',
    						'thumbnail',
    						'excerpt',
    						'custom-fields',
    						'comments')
    					)
    				);
    	register_taxonomy('portfoliocat', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Categories', 'singular_name' => 'Category', "rewrite" => true, "query_var" => true));
    }
    
    add_action('init', 'my_post_type_portfolio');

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Removing 'portfolio-view' from url – almost what is missing from code?’ is closed to new replies.
Skip to toolbar