Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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?

    #519068

    Hello,

    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 4 years, 8 months ago by  Dino.
    #519674

    Hi!

    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,
    Ismael

    #520029

    Hi 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,
    Dino

    #520448

    Hi 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,
    Dino

    #520851

    Hey!

    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,
    Ismael

    #576690

    Hi,

    What did you do to solve the problam?

    Thanks, Segev.

    #576721

    Hi!

    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,
    Basilis

    #578065

    Hi,

    If I will do the change, then if I will update the Enfold theme it will delete the changes?

    Thanks, Segev.

    #578067

    Hi!

    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,
    Basilis

    #578077

    Thanks.

    #578340

    Hi,

    Glad we could help :-)

    Regards,
    Rikard

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

You must be logged in to reply to this topic.