-
AuthorPosts
-
October 14, 2015 at 11:05 pm #518970
Hi,
da dies etwas schwieriger ist für mich auf Englisch zu Fragen schreibe ich ausnahmsweise auf Deutsch.
Ich würde gerne in der URL die Category des portfolios anzeigen. Ich habe mich schon durch das Forum gekämpft aber nichts hat geholfen.
Mal geht Garnichts, mal wir die URL so dergestalt wie ich das möchte aber bekomme dann Error 404. Ich habe auch schon verschiedene Plugins versucht wie Custom Post Type Permalinks oder WP Permalauts.Hat jemand ne Idee wie man das lösen kann?
October 15, 2015 at 8:53 am #519068Hello,
I use WP Permalauts and set the Permalinks Screenshot
Now it works, but there is no sub_category in the URL.
I try with /%portfolio_category%/%portfolio_entries%/%postname%/ but this is not working.The URL looks now like this http://www.acus-reisen.de/tuerkei/istanbul/ but I need it like http://www.acus-reisen.de/tuerkei/Istanbul&Marmara/istanbul/
#EDIT
I tray it with Custom Post Type Permalinks. The URL looks like I want to have it http://www.acus-reisen.de/tuerkei/istanbul-marmara/istanbul/ but I get Page Erro 404.
Any Idea?
- This reply was modified 9 years, 2 months ago by Dino.
October 16, 2015 at 5:48 am #519674Hi!
Thank you for using Enfold.
Please add this in the functions.php file:
add_filter('post_type_link', 'post_type_link_mod', 10, 4); function post_type_link_mod($post_link, $post, $leavename, $sample) { if ( false !== strpos( $post_link, '%portfolio_entries%' ) ) { $portfolio_entries = get_the_terms( $post->ID, 'portfolio_entries' ); $post_link = str_replace( '%portfolio_entries%', array_pop( $portfolio_entries )->slug, $post_link ); } return $post_link; } add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod'); function avf_portfolio_cpt_args_mod($args) { $permalink = get_option('avia_permalink_settings'); $args['rewrite']['slug'] = $permalink['portfolio_permalink_base'] . '/%portfolio_entries%'; return $args; }
Flush or resave the permalink settings afterwards:
Best regards,
IsmaelOctober 16, 2015 at 3:10 pm #520029Hi Ismael,
thy for fast replay. I it works now but the URL show just the main Category not the Sub Category http://www.acus-reisen.de/tuerkei/istanbul/
Regards,
DinoOctober 17, 2015 at 6:31 pm #520448Hi Ismael,
when I use your code its work but the sub-category is not in the URL and the static sites don’t work got error 404.
If I activate Custom Post Type Permalinks the URL is shown correct but then I got error 404 on portfolio sites and the static sites works.Regards,
DinoOctober 19, 2015 at 12:10 pm #520851Hey!
Please deactivate the permalink plugins when you add the code and make sure to flush the Settings > Permalink options afterwards. I’m not sure if it’s possible to add more than one category in the url even with the use of a plugin. I’ll ask the rest of the support team to check.
Best regards,
IsmaelFebruary 2, 2016 at 9:05 pm #576690Hi,
What did you do to solve the problam?
Thanks, Segev.
February 2, 2016 at 9:49 pm #576721Hi!
yes it will most probably do. That is the way we actually try to debug those issues the best way possible.
Please try Ismael suggestion and if it does not work, then do ask us again.Best regards,
BasilisFebruary 4, 2016 at 9:31 pm #578065Hi,
If I will do the change, then if I will update the Enfold theme it will delete the changes?
Thanks, Segev.
February 4, 2016 at 9:32 pm #578067Hi!
If you update enfold theme, make sure you have a child theme created with the functions.php code pasted there, so it does not get lost from your installation.
Best regards,
BasilisFebruary 4, 2016 at 9:44 pm #578077Thanks.
February 5, 2016 at 8:06 am #578340 -
AuthorPosts
- You must be logged in to reply to this topic.