Permalink Customization

This topic contains 9 replies, has 2 voices, and was last updated by  CTHthemes 3 years, 5 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8911

    dimitrim
    Participant

    Support Expired

    As adviced on themeforest I have started a thread here. I want to basically customize the permalinks as mentioned below.

    1. The default url for a portfolio would be http://www.test.com/portfolio/project

    I want to remove the term ‘portfolio’completely so the url reads. http://www.test.com/project

    I did read a previous comment from you guys to another buyer that said to set the has_archive to false in the cth_outdoor_plugins.php file. But that did not work.

    2. If I create a portfolio in the backend named “project” and add it to a category called “Nature” then can I display the front end permalink to display

    http://www.test.com/nature/project

    I’ve looked around the themes function file but no permalink declarations have been made there to modify. Some help would be very much appreciated. Thanks!

    #8913

    CTHthemes
    Keymaster

    1, please download the outdoor-child theme bellow.
    Upload to install and active it.
    Click Save Changes button on Settings -> Permalinks screen.

    2, It’s not possible.

    #8923

    dimitrim
    Participant

    Support Expired

    That works perfectly! Thank you!

    One more thing before I’m done with harassing you guys with multiple things. I should have realised that ‘portfolio_cat’ would not magically disappear with this as well. But I’m sure the code is very much similar for the functions in the child theme. However it is a little too advanced for me to conjure up on my own. If you guys could help with that it would be pretty darn amazing and much appreciated.

    Just to be clear the category archive page has the term : ‘portfolio_cat’
    http://www.test.com/portfolio_cat/nature

    Would like it to read :
    http://www.test.com/nature

    Noticed your message on the functions file about duplicate permalinks and custom post types. I’m aware and will be mindful. Thanks!

    #8929

    CTHthemes
    Keymaster

    Hi, please try add the code bellow to child theme functions.php file:

    
    function outdoor_custom_portfolio_cat_link( $link, $term, $taxonomy )
    {
        if ( $taxonomy !== 'portfolio_cat' )
            return $link;
    
        return str_replace( '/portfolio_cat/', '/', $link );
    }
    add_filter( 'term_link', 'outdoor_custom_portfolio_cat_link', 10, 3 );
    

    I found it at: http://wordpress.stackexchange.com/questions/21076/remove-taxonomy-base-or-term-from-url

    Thanks.

    #8935

    dimitrim
    Participant

    Support Expired

    It does remove the portfolio_cat from the url. However the page returns a 404 error.

    #8940

    CTHthemes
    Keymaster

    Hi, please try click to Save Changes button on Settings -> Permalink screen.

    #8941

    dimitrim
    Participant

    Support Expired

    I did try that already but no luck. Did it work without a problem on your end?

    #8944

    CTHthemes
    Keymaster
    #8972

    dimitrim
    Participant

    Support Expired

    That worked perfectly. I was going to write back and say that I already came across the custom permalinks and it works for emulating the category in the url but you guys beat me to it.

    Thank you so much for all your help appreciate it immensely!

    #8979

    CTHthemes
    Keymaster

    You are welcome 🙂

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

New featues: CityBook - Listing & Directory WordPress Theme version 2.1.8 was outUpdate now
+