New Landing How can we help? Cardinal "Error 404" with Portfolio Custom Permalink

Viewing 15 posts - 1 through 15 (of 17 total)
  • Posted in: Cardinal
  • #100315
    Anonymous
    Inactive

    Hi, guys! It’s simple.

    I need this: mysite.com/portfolio-category-slug/post-name ยป mysite.com/cars/ferrari
    But I get this: mysite.com/portfolio-base-slug/post-name ยป mysite.com/portfolio/ferrari

    So, I installed Remove Taxonomy Base Slug plugin to remove Categories Base Slugs from permalinks in Archives and stuff, as Ed suggests in ThemeForest commentaries, and works very well. But I need to remove Portfolio Base from Single Pages and include the Category Slug too, the same way I do with common posts in WordPress ( /%category%/%postname% ).

    I tried Custom Post Type Permalinks plugin to include the Category Slug and with Remove Taxonomy Base Slug I get exactly what I need… but it always returns 404.

    I know it’s something with the way CPTs are registered, ’cause with my last theme I made some modifications (rewrite and stuff) and I managed to include the Category Slug without remove the Portfolio Base.

    But I believe with Cardinal I can! So… what I need to do? Oh… and I prefer something to include in the Child Theme functions.php, ’cause I don’t want to change parent files and lost everything if I forget to do it again.

    Thanks!

    #100396
    Anonymous
    Inactive

    Oh… the SAME for any others CPTs too (Galleries, Directory and stuff).

    Thanks!

    #101002
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    I will forward this to the developer as he may be familiar with the plugin

    Sorry about the wait

    – Kyle

    #101085
    Anonymous
    Inactive

    Thanks! I know this is possible with some rewrite modifications, but I don’t know HOW to make this properly and HOW to include them in the functions.php file of my Child Theme, so I don’t lost everything in the next update.

    Would be nice if you guys include in the next update, with that Custom Base Slug options. Some kind of new option to enable/disable Categories Slug in permalinks and stuffs could work.

    It’s useful to grant the CPTs a more extensive and creative use. For example, I need this to create multiple profiles/portfolios for Bands, Models and Tattoo Artists. Other people can make the same to showcase profiles of artists, portfolios of students, extend the Directory and stuff.

    If we talking about a truly Multi-Purpose, so this is a REALLY useful function for Cardinal. ๐Ÿ˜‰

    #101592
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @davideassis,

    Did you try saving the permalinks in Settings > Permalinks, AFTER enabling that plugin – to flush the permalinks?

    – Ed

    #101594
    Anonymous
    Inactive

    Yes! And I Flush the Rewrite Rules too… with a plugin!

    I believe it’s something with the rewrite rules and the way the CPTs are registered. I need something without CTP base slug… but with Categories Slugs… just like the regular posts:

    mysite.com/cpt-category-slug/post-name

    :/

    #101663
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    I’ve looked into this a little further, and I don’t think it is generally advised to remove the base. I did find this, give it a try? http://colorlabsproject.com/tutorials/remove-slugs-custom-post-type-url/

    – Ed

    #101686
    Anonymous
    Inactive

    I found this too and I tried, but doesn’t works. I believe is something with the way the Cardinal CPTs are registered. I found this one, but don’t understand it very well: http://wordpress.stackexchange.com/questions/21022/mixing-custom-post-type-and-taxonomy-rewrite-structures

    Last time I used Custom Post Type Permalinks plugin this in the Taxonomy:

    'rewrite' => array('slug' => 'glossary',),

    And managed to include the Portfolio Category in the Permalink without the Taxonomy Base… but I can’t hide the Portfolio Base Slug. ๐Ÿ™

    #101690
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Well nothing is “wrong” with the way the post type is registered. If you want to change the parameters for the post type, you can find it in /swift-framework/custom-post-types/portfolio-type.php

    – Ed

    #101692
    Anonymous
    Inactive

    I don’t say wrong… I say different of what I need to make this things work.

    With both plugins I managed the create the permalinks exactly how I need, but it always returns 404. So, maybe, I need to change the rewrite rules and stuff, but that’s the problem: I don’t know HOW!

    Maybe I’m missing something with the registration and rewrite code, that’s why I’m looking the support.

    Please, install both plugins and try to remove the bases and include the category slug for Portfolios. As a Developer you will understand the results better than me.

    I just need to know what to change, and will do it by myself after.

    #101694
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    I’ve never personally tried to remove the base, because everywhere I’ve read has said that it’s not advised for various reasons.

    All I would do in the case that I wanted to do, would be to go through various Google results for how to do it: https://www.google.co.uk/search?q=remove+custom+post+type+base&oq=remove+custom+post+type+base&aqs=chrome..69i57.3055j0j7&sourceid=chrome&es_sm=91&ie=UTF-8

    I’d suggest you attempt those, and hopefully find one that works.

    – Ed

    #101695
    Anonymous
    Inactive

    Forget it. I tried a lot of stuff from Google already. Thought the support could be more helpful with this. If I need to try and do stuff like this all by myself, without any slight direction or advices, I don’t know why look for the forum.

    I mean… all I need is know what to change, how to change… and I do by myself.

    If it’s possible when I create CPTs with third-party plugins, should be possible with the already created Portfolio Post Type, so I can use the theme resources more easily.

    #101696
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi David,

    You have to understand that we simply don’t have the time to investigate customisations outside the standard scope of the theme – investigating something like this and finding a solution could take hours, and even after that it could come to the realisation that custom htaccess rules are needed.

    If it was something simple, then we’d be happy to help, but you have to understand that we are here to support the theme and it’s standard functionality.

    Which plugin are you using for custom post types, where you are able to remove the base? I can check the code to see if there is anything you can change.

    – Ed

    #101704
    Anonymous
    Inactive

    I understand, really! But all the CTPs are handled with a framework and a lot of complex codes for regular users. If I open the portfolio-type.php file I don’t understand how the CTP and CT are handled with the rewrite thing, ’cause there’s ‘swift-framework-admin’ and untrailingslashit with the code I don’t know WTF is this! LOL!

    If we’re talking about common CTPs registered as a lot of common tutorials explains, I could use a lot of other common tutorials to change slugs and permalinks. But is not the case here and is hard as hell to understand the current code.

    Anyway… I managed to include the Portfolio Category slug in the permalink with a simple function without change the framework files. Just need to be included in the functions.php in the Child Theme folder.

    I found the solution here: http://wordpress.stackexchange.com/questions/108642/permalinks-custom-post-type-custom-taxonomy-post

    First of all: “Custom Post Type Permalinks” plugin DOESN’T WORKS with Cardinal and messes even with the regular permalink structure.

    Second: Just include this in the functions.php file:

    // INCLUDES TAXONOMY SLUG IN THE PERMALINK STRUCTURE (PORTFOLIO)
    
    function wpa_show_permalinks( $post_link, $id = 0 ){
        $post = get_post($id);
        if ( is_object( $post ) && $post->post_type == 'portfolio' ){
            $terms = wp_get_object_terms( $post->ID, 'portfolio-category' );
            if( $terms ){
                return str_replace( '%portfolio-category%' , $terms[0]->slug , $post_link );
            }
        }
        return $post_link;
    }
    add_filter( 'post_type_link', 'wpa_show_permalinks', 1, 2 );

    Third: Go to Settings ยป Permalinks and change the Portfolio Custom Base to:

    /portfolio/%portfolio-category%
    

    In my case I use “net” instead “portfolio”. People can use any base they want.

    Fourth and Last: Just to be sure I cleaned the Cache and I Flush The Rewrite Rules and saved the Permalinks Structure again.

    Everything works like I charm now!

    BUT… as you see, Ed, I can’t remove the Portfolio Slug base. Would be better to get rid of this and use only the “Portfolio Category Slug/Post Name” in the permalink, as all the other posts.

    If you can verify this… just this… maybe you can find a way to remove the CPT Base Slug.

    And I REALLY REALLY suggest integrate this solution in the next update.

    Using only mysite.com/portfolio/postname it’s more than enough for Companies and Designers Portfolios, but for Magazine-style sites we need a more creative and flexible solutions or these great CPTs becomes useless.

    Just see:

    Directory: mysite.com/places/restaurants/joesdinner
    Portfolios: mysite.com/cars/ferraris/ferrari-458-spider
    Galleries: mysite.com/galleries/destinations/hawaii

    And if we can remove the CTPs Bases, so Cardinal can be use for niches sites and specific themes with more pretty and professional permalinks. See:

    Directory: foodisgood.com/restaurants/joes-dinner || foodisgood.com/blog/why-joes-dinner
    Portfolios: carsarecool.com/ferraris/ferrari-458-spider || carsarecool.com/blog/why-ferrari-458-spider
    Galleries: seetheworld.com/destinations/hawaii || seetheworld.com/blog/why-hawaii

    CTPs (with blank templates) extends the site and the regular Posts can be use ONLY for blog (’cause it’s terrible mix them), so we can organize and separate the content and even use the Page Builder more creatively. Oh… and the SEO?! Just perfect! <3

    And the best: we don’t need to install a lot of plugins to achieve something like this. It’s just more performance, stability, compatibility and everything is damn simple!

    Well… I’m just trying to help here! Help Cardinal grows as a user and new fan of theme too… and help other people with the solutions I found.

    That’s why I always answer the posts with what I do in my own site. ๐Ÿ˜‰

    Please, think about!

    #101729
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi David,

    I definitely agree that it would be nice – let me see what we can do as an option for the future. As I said though, I don’t think it’s hard on purpose – I have read a lot of articles which advise against removing the base.

    – Ed

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register