WordPress.org

Ready to get started?Download WordPress

Forums

Qtranslate Slug
Home link is not working (4 posts)

  1. paramir
    Member
    Posted 1 year ago #

    hello there,
    I am using the wp_nav_menu to generate a custom menu. I am using the right function for generating the language menu (<?php if (function_exists('qts_language_menu') ) qts_language_menu('image'); ?>), and when trying to navigate to the homepage (root url) I get a 404. If the option 'Hide URL language information for default language' is on, only the second lang. is giving the trouble (thus example.com/wp/ works fine, while example.com/wp/en/ returns a 404).
    Somebody?

    http://ehudneuhaus.com/clients/muizenhuis/_wpfiles/

    http://wordpress.org/extend/plugins/qtranslate-slug/

  2. c4web
    Member
    Posted 1 year ago #

    I have the same problem, but only with a template, all the other work. Maybe it's a problem with the template? Appearance solutions too :-)

  3. CoCumis
    Member
    Posted 10 months ago #

    Hello, I have this problem when I use custom permalink. When permalink is set to /%postname%/ all works ok in all languages. But when I set it like this /blog/%postname%/ home page (static front page) work only with default language. In another language which have prefix for example /en/ it give me 404 page Please help me with this problem.

  4. CoCumis
    Member
    Posted 9 months ago #

    Hi, I resolve this problem with this snippet

    if ( count( $query ) == 1 && isset( $query['error'] ) )
    	unset( $query['error'] );

    copy it to filter_request function in qtranslate-slug.php before

    // -> home url
    if ( empty($query) ):
    	$function = 'home_url';
    	$id = '';
    endif;

    So it should be like this

    // -> home url
    // fix if you are using custom permalink (for example/blog/%postname%)
    if ( count( $query ) == 1 && isset( $query['error'] ) )
    	unset( $query['error'] );
    
    if ( empty($query) ):
    	$function = 'home_url';
    	$id = '';
    endif;

    For now I don't test it so much. If I'll have some issue with this, I post it here.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags