Okay
  Public Ticket #2208782
Portfolio Tag Custom slug
Closed

Comments

  • ziskar364 started the conversation

    Hello,

    First, congrats for your very nice work and documentation.

    We are developing our new website using Kalium with the Agency demo.

    I activated the portfolio tag from Portfolio Settings -> Portfolio Page -> URL Rewrite Options and now i am trying to find out ( without success) how to give custom slug for portfolio tag url.  Please for your feedback.

    Thanks in advance.

    Konstantinos Anastasiou.

    Web Developer

  •  848
    Art replied

    Hi Konstantinos,

    I am not sure if I understand your question, the tags will generate the slug depending on their name, are you talking about the /portfolio/ archive URL which you want to change?  In theme documentation there is an article which may help you.

    Kind regards,
    Art


      Documentation        Follow on Envato         Like on Facebook

  • ziskar364 replied

    Hi Art, 

    I'm talking about the Portfolio Tags category. I activated it through Kalium Settings panel, as you can see in screenshots 1 and 2. 

    I see that you have implemented what i'm searching for portfolio slug and portfolio categories slug in the URL Rewrite Options section (Screenshot 3). 

    I want to do the same thing for the Portfolio tags category. I need to change the 'portfolio_tag' prefix with my custom string.

     For example in mywebsite.gr/portfolio_tag/seo/, i want to replace the  'portfolio_tag' string.

    Kind regards,

    Konstantinos

    Attached files:  Screen1-enable_portfolio_tags.JPG
      Screen2-portfolio_tags.JPG
      Screen3-rewrite_options.JPG

  •  848
    Art replied

    Hi Konstantinos,

    I understand what you mean, firstly make sure you're using the child theme, and then go to Appearance > Editor and put this in functions.php file:

    add_filter( 'portfolioposttype_tag_args', function( $args ) {
        $args['rewrite']['slug'] = 'tag-prefix-here';
        return $args;
    } );
    

    Change the tag-prefix-here with the prefix you would like to have and then flush rewrite the permalinks so the changes will be applied.

    Kind regards,
    Art


      Documentation        Follow on Envato         Like on Facebook

  • ziskar364 replied

    Hi Art, 

    It's exactly what i needed! Thank you very much. 

    Kind regards, 

    Konstantinos

  • ziskar364 replied

    Hi Art,

    Do you have filters like this, also for portfolio category and portfolio single?

    I am asking this, because in that way, we can translate slugs with WPML.

    Kind regards,

    Konstantinos 

  •  848
    Art replied

    Hi there,

    You can change them from the Theme Options:

    medium
    (view large image)

    Kind regards,
    Art


      Documentation        Follow on Envato         Like on Facebook

  • ziskar364 replied

    Dear Art,
    we have already found those options at the admin panel but we are not able to translate the related slugs with WPML,  thus it would be really helpful to have the respective filters for both portfolio category and single in order to use wpml string translator because the website is multilingual. Using the filter you gave us earlier for tags slug we have already managed to translate the respective slug.

    Best regards 


  •  848
    Art replied

    Hi again,

    To translate them in the admin panel navigate to WPML > Translation Management and tick the Custom Posts Slug Translation Options.

    Kind regards,
    Art


      Documentation        Follow on Envato         Like on Facebook

  • ziskar364 replied

    Thank you, we 'll try that.

    Best regards

  •  848
    Art replied

    You're welcome.

    Kind regards,
    Art


      Documentation        Follow on Envato         Like on Facebook