Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Use portfolio categories in portfolio item url
New Landing › How can we help? › Themeforest Theme Support › Dante › Use portfolio categories in portfolio item url
- This topic has 9 replies, 2 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Dante
-
February 15, 2014 at 9:47 am #49135
Hi again,
How can insert the portfolio category slug into the url of the portfolio items, so I achieve something like http://www.kamillaruus.dk/galleri/portfolio-category/post name/.
I have tried to insert the following in permalinks under Portfolio permalink base => Custom base: /galleri/%portfolio-category%.
That doesn’t seem to work.
Best regards.
Morten Ruus
February 18, 2014 at 8:14 am #49845Hi,
First use custom rule like/galleri/%portfolio-category%/ and put this code functions.php at end of file add_filter('post_type_link', 'swift_portfolo_permalink', 1, 3); function swift_portfolo_permalink($permalink, $post_id, $leavename) { if (strpos($permalink, '%portfolio-category%') === FALSE) return $permalink; // Get post $post = get_post($post_id); if (!$post) return $permalink; // Get taxonomy terms $terms = wp_get_object_terms($post->ID, 'portfolio-category'); if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug; else $taxonomy_slug = 'portfolio-category'; return str_replace('%portfolio-category%', $taxonomy_slug, $permalink); } It will help you sure . With Best Regards Swiftideas Themes
March 2, 2014 at 3:52 pm #53239Thank you for your answer. I will try that.
Best regards
MortenMarch 2, 2014 at 4:00 pm #53242Hi,
It is tested solution and will work 100% . I will wait for your feedback .
Thanks
With Best Regards
Swift IdeasMarch 2, 2014 at 4:31 pm #53249Thank you Mohammad.
It works which you can see here http://www.kamillaruus.dk/galleri/graphic-design/desert-mini-planet/ and in the attachment.Best regards
MortenMarch 2, 2014 at 4:43 pm #53251Hi,
I’m glad that its worked . Do you need more help ?
With Best Regards
Swift IdeasMarch 2, 2014 at 5:50 pm #53252In fact I do.
I’m going to make two subpages under “Galleri”. One is called “Akrylmalerier” and the other one is going to be called “Akvareller” (in English Paintings and watercolors).
How can I differentiate the urls to the index gallery icon, when I’m looking at a portfolio item – please se attachment?
Portfolio items for “Akrylmalerier” should lead to “Akrylmalerier” (url http://www.kamillaruus.dk/akrylmalerier/) and portfolio items for “Akvareller” should lead to “Akvareller”.Looking forward to hear from you.
Best regards
MortenMarch 4, 2014 at 2:33 pm #53990Hi,
If you provide wordpress admin login detail so i can look in to this to find any solution .
ThanksMarch 9, 2014 at 4:02 pm #55761I think I’ll use the categories as subpages to gallery page instead, so the gallery page will be the main portfolio.
But thank you for your help.Best regards
MortenMarch 10, 2014 at 1:59 am #55790Hi,
You most welcome
Thanks 🙂
With Best Regards
Swift Ideas -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.