Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #538559

    Hi There! Is there a simple way to remove the terms “portfolio item” and “porfolio entrie” at the URL?

    Example:
    http://dambroz.com.br/portfolio-item/grandversatille/
    to
    http://dambroz.com.br/grandversatille/

    http://dambroz.com.br/portfolio_entries/bomba/
    to
    http://dambroz.com.br/bomba/

    Thank you!

    #538603

    Hi educode!

    Please do go to your Permalink settings ( Settings -> Permalinks ) and you will be able to change those!
    Let us now if that fit your needs.

    Cheers!
    Basilis

    #538944

    Hello Basilis, I have tried this before but no one of the options does what I asked, could you tell me what I need to do exactly?

    thank you!

    #540560

    Hi!

    Please add this in the functions.php file:

    add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod');
    function avf_portfolio_cpt_args_mod($args) {
    	$args['rewrite']['slug'] = 'portfolio';
        //$args['rewrite']['with_front'] = false;
    	return $args;
    }
    
    add_filter( 'post_type_link', 'ava_remove_custom_slug', 10, 3 );
    function ava_remove_custom_slug( $post_link, $post, $leavename ) {
        if ( 'portfolio' != $post->post_type || 'publish' != $post->post_status ) {
            return $post_link;
        }
    
        $post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
    
        return $post_link;
    }

    After that, go to the Settings > Permalinks panel then click “Save” to update the permalinks.

    Regards,
    Ismael

    #703916

    Hi!

    I used this code, because I have the same issue that Basilis. But all my links are broken now. 404.

    When you see the link structure, that´s ok – http://www.site.com/with-out-portfolio-item – but doesn´t show the page. Erro 404

    Can you help me?

    • This reply was modified 8 years, 1 month ago by Flávio Pavanelli. Reason: show the link
    #703948

    Hey!

    WHen you use the code, please also re-flush by going to Dashboard -> Settings -> Permalinks and press ave to custom.

    Thanks a lot

    Regards,
    Basilis

    #703967

    Doesn´t Work. But that´s ok! I figured out the other way to solve this issue. Tks Basilis!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Cleaning Permalink’ is closed to new replies.