This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Portfolio slug

  • Creator
    Topic
  • #24531
    Brett
    Participant

    I am creating a site that needs “case studies” rather than “portfolio”. I don’t really care about what it says on the back end but the urls for portfolio items is http://mysite.com/items/

    I see in your faq that you can changes this with

    function my_portfolio_tax_args( $args ) {
        $args['rewrite'] = array('slug' => 'my-slug');
        return $args;
    }
    add_filter('themeblvd_portfolio_tax_args', 'my_portfolio_tax_args');

    and

    function my_portfolio_tag_tax_args( $args ) {
        $args['rewrite'] = array('slug' => 'my-other-slug');
        return $args;
    }
    add_filter('themeblvd_portfolio_tag_tax_args', 'my_portfolio_tag_tax_args');

    I changed ‘my-slug’ to ‘casestudies’ but it doesn’t seem to be working. I resaved the permalinks but it continues to use ‘items’

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #24532
    Jason Bobich
    Keymaster

    Apologies, I’m not sure on that one. I just tested on my end. I copied the snippet here, pasted in my functions.php, and then re-saved my permalink settings, and all seemed to work.

    Are you possibly mixing up the permalinks of the taxonomy archives with the actual single posts?

    #24533
    Brett
    Participant

    I should just need to add

    function my_portfolio_tax_args( $args ) {
    $args[‘rewrite’] = array(‘slug’ => ‘my-slug’);
    return $args;
    }
    add_filter(‘themeblvd_portfolio_tax_args’, ‘my_portfolio_tax_args’);

    as it is and then customize the my-slug right? I added this to functions.php, resaved permalinks and then created a new portfolio item, published it and clicked view item and I am still getting /item/

    Being on a subdomain for development shouldn’t affect anything right?

    #24535
    Brett
    Participant

    I figured it out, it was a taxonomy vs. the single post.

    I looked through your github repo and realized I needed to change themeblvd_portfolio_item_cpt_args and not themeblvd_portfolio_tax_args”

    Is it possible to rewrite the labels as well? It is not a huge deal but it would probably cause less confusion on the client’s end if portfolio said case study instead.

    • This reply was modified 5 years, 9 months ago by Brett.
    #24537
    Jason Bobich
    Keymaster

    Sure, why not. You’re already filtering the arguments, so just traverse into editing the labels array. Or if that’s confusing for you, alternively you can use the “‘themeblvd_portfolio_item_cpt_labels” filter. Just look at where the post type is registered in GitHub repo; everything is filterable.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.