Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 2.37 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by davideV-2 5 years, 6 months ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
January 25, 2016 at 2:55 pm #795697

davideV-2

Hello,

On website hidden link when user try to login user gets redirected to 404 ERROR PAGE instead to be redirected to correct welcome page.

Theme designer said to contact you because they cant find the issue.

I attach the error message and please help me

Please see php file below:

<?php

/*Template Name: Login Template */

get_header();

$tpl_default_settings = get_post_meta( $post->ID, '_tpl_default_settings', TRUE );

$tpl_default_settings = is_array( $tpl_default_settings ) ? $tpl_default_settings : array();

$page_layout = array_key_exists( "layout", $tpl_default_settings ) ? $tpl_default_settings['layout'] : "content-full-width";

$show_sidebar = $show_left_sidebar = $show_right_sidebar = false;

$sidebar_class = "";

switch ( $page_layout ) {

case 'with-left-sidebar':

$page_layout = "page-with-sidebar with-left-sidebar";

$show_sidebar = $show_left_sidebar = true;

$sidebar_class = "secondary-has-left-sidebar";

break;

case 'with-right-sidebar':

$page_layout = "page-with-sidebar with-right-sidebar";

$show_sidebar = $show_right_sidebar = true;

$sidebar_class = "secondary-has-right-sidebar";

break;

case 'both-sidebar':

$page_layout = "page-with-sidebar page-with-both-sidebar";

$show_sidebar = $show_right_sidebar = $show_left_sidebar = true;

$sidebar_class = "secondary-has-both-sidebar";

break;

case 'content-full-width':

default:

$page_layout = "content-full-width";

break;

}

if ( $show_sidebar ):

if ( $show_left_sidebar ): ?>

<!-- Secondary Left -->

<section id="secondary-left" class="secondary-sidebar <?php echo $sidebar_class;?>"><?php get_sidebar( 'left' );?></section><?php

endif;

endif;

?>

<!-- ** Primary Section ** -->

<section id="primary" class="<?php echo $page_layout;?>">

<!-- Login Module -->

<?php if( is_user_logged_in() ) {

$link = dttheme_get_page_permalink_by_its_template('tpl-welcome.php');

if ( !empty( $link )) {

return wp_redirect( $link );

}

} else { ?>

<!-- Login Form -->

<div class="column dt-sc-one-half first">

<div class="dt-sc-border-title"> <h2><span><?php _e('Login Form','dt_themes');?></span> </h2></div>

<p> <?php _e('Already a Member? Log in here.','dt_themes');?> </p>

<form name="loginform" id="loginform" action="<?php echo home_url();?>/wp-login.php" method="post">

<p>

<label><?php _e('Username','dt_themes');?><span class="required"> * </span></label>

<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" required="required" />

</p>

<p>

<label><?php _e('Password','dt_themes');?><span class="required"> * </span> </label>

<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" required="required" />

</p>

<p class="forgetmenot">

<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> <?php _e('Remember Me','dt_themes');?></label>

</p>

<p class="submit alignleft">

<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php _e('Log In','dt_themes');?>" tabindex="100" />

</p>

<?php $link = dttheme_get_page_permalink_by_its_template('tpl-welcome.php');

$link = !empty( $link ) ? $link : home_url(); ?>

<input type="hidden" name="redirect_to" value="<?php echo $link;?>" />

</form>

<p class="tpl-forget-pwd"><a href="<?php echo home_url(); ?>/wp-login.php?action=lostpassword"><?php _e('Lost your password?','dt_themes');?></a></p>

</div><!-- Login Form End -->

<!-- Registration Form -->

<div class="column dt-sc-one-half">

<div class="dt-sc-border-title"> <h2><span><?php _e('Register Form','dt_themes');?></span> </h2></div>

<p> <?php _e('Do not have an account? Register here','dt_themes');?> </p>

<form name="loginform" onsubmit="if(document.getElementById('agree').checked) { return true; } else { alert('Please indicate that you have read and agree to the Terms and Conditions and Privacy Policy'); return false; }" id="loginform" action="<?php echo home_url(); ?>/wp-login.php?action=register" method="post">

<p>

<label><?php _e('Username','dt_themes');?><span class="required"> * </span> </label>

<input type="text" name="user_login" class="input" value="" size="20" required="required" />

</p>

<p>

<label><?php _e('Email Address','dt_themes');?><span class="required"> * </span> </label>

<input type="email" name="user_email" class="input" value="" size="20" required="required" />

</p>

<p>

<label><?php _e('Role','dt_themes');?><span class="required"> * </span> </label>

<select name="role" id="role">

<?php

$status = dttheme_is_plugin_active('s2member/s2member.php');

if($status) {

?>

<option value="s2member_level1"><?php echo __('Student', 'dt_themes'); ?></option>

<?php

}

?>

</select>

</p>
<?php
if(defined('ICL_LANGUAGE_CODE') && ICL_LANGUAGE_CODE == 'it') {
?>
<p><input type="checkbox" name="checkbox" value="check" id="agree" /> Ho letto ed accettato i <?php echo __('<a href="hidden link">Termini e Condizioni</a>','dt_themes'); ?> e le <a href="hidden link" target="_blank">Informazioni sulla Privacy</a></p>
<?php
} else {
?>
<p><input type="checkbox" name="checkbox" value="check" id="agree" /> I have read and agree to the <?php echo __('<a href="hidden link">Terms and Conditions</a>','dt_themes'); ?> and <a href="hidden link" target="_blank">Privacy Policy</a></p>
<?php
}
?>

<p class="submit alignleft"><input type="submit" class="button-primary" value="<?php _e('Register','dt_themes');?>" /></p>

</form>

</div><!-- Registration Form End -->

<div class="clear"></div>

<?php }?>

<!-- Login Module End-->

<?php

if( have_posts() ):

while( have_posts() ):

the_post();

get_template_part( 'framework/loops/content', 'page' );

endwhile;

endif;?>

</section><!-- ** Primary Section End ** --><?php

if ( $show_sidebar ):

if ( $show_right_sidebar ): ?>

<!-- Secondary Right -->

<section id="secondary-right" class="secondary-sidebar <?php echo $sidebar_class;?>"><?php get_sidebar( 'right' );?></section><?php

endif;

endif;?>

<?php get_footer(); ?>

support lms prob.PNG
error.PNG
January 26, 2016 at 10:12 am #796345

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

Thank you for contacting WPML support.

Please replace the following code from the above Login template

<form name="loginform" id="loginform" action="<?php echo home_url();?>/wp-login.php" method="post">

By

<form name="loginform" id="loginform" action="<?php echo site_url();?>/wp-login.php" method="post">

Please let me know if the above solution works for you, I look forward to your reply!

Thanks

January 26, 2016 at 1:41 pm #796611

davideV-2

yes is working!