Forum Replies Created

Viewing 15 replies - 1 through 15 (of 28 total)
  • Thread Starter morality28

    (@morality28)

    Thank you so much Chad – changing to login_redirect worked perfectly!

    I believe I had added that code to redirect a specific group of users (subscribers) to a different page on login than everyone else.

    Thread Starter morality28

    (@morality28)

    I must admit I don’t know much about this stuff so I really appreciate your help. I haven’t changed anything in functions.php and it used to work fine. Here is the code I’ve added. I’m not sure if I found it in your FAQ or not…

    add_filter( ‘wpmem_login_redirect’, ‘my_login_redirect’, 10, 3 );

    function my_login_redirect( $redirect_to, $request, $user ) {
    //is there a user to check?
    if (isset($user->roles) && is_array($user->roles)) {
    //check for subscribers
    if (in_array(‘subscriber’, $user->roles)) {
    // redirect them to another URL
    $redirect_to = site_url( ‘/psw-training/’ );
    }
    }

    return $redirect_to;
    }

    add_action( ‘template_redirect’, ‘my_redirect_to_login’ );
    function my_redirect_to_login() {
    if ( ! is_user_logged_in() && wpmem_current_url() == site_url( ‘/staff/’ ) ) {
    wpmem_redirect_to_login();
    }
    return;
    }

    add_action( ‘template_redirect’, ‘my_redirect_to_login’ );
    function my_redirect_to_login2() {
    if ( ! is_user_logged_in() && wpmem_current_url() == site_url( ‘/calendar/’ ) ) {
    wpmem_redirect_to_login();
    }
    return;
    }

    add_action( ‘template_redirect’, ‘my_redirect_to_login’ );
    function my_redirect_to_login3() {
    if ( ! is_user_logged_in() && wpmem_current_url() == site_url( ‘/category/dementia-training/’ ) ) {
    wpmem_redirect_to_login();
    }
    return;
    }

    Thread Starter morality28

    (@morality28)

    Thank you – I followed all the instructions to turn on debug mode. Now I don’t see any error messages, just the white screen. Again if I hit enter on the url of the white screen, it reloads the login page just fine. The debug log didn’t find anything either. I did find an error log however – it looks like it might be wp-members and my theme not playing nicely together:

    [08-Sep-2020 15:34:01 UTC] PHP Fatal error: Uncaught Error: Call to undefined function wpmem_current_url() in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php:21
    Stack trace:
    #0 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(287): my_redirect_to_login(”)
    #1 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #2 /home/alzniag/public_html/volunteers/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/alzniag/public_html/volunteers/wp-includes/template-loader.php(13): do_action(‘template_redire…’)
    #4 /home/alzniag/public_html/volunteers/wp-blog-header.php(19): require_once(‘/home/alzniag/p…’)
    #5 /home/alzniag/public_html/volunteers/index.php(17): require(‘/home/alzniag/p…’)
    #6 {main}
    thrown in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php on line 21
    [08-Sep-2020 15:35:53 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_login_redirect(), 2 passed in /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php:5
    Stack trace:
    #0 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(287): my_login_redirect(‘https://voluntee…’, 1)
    #1 /home/alzniag/public_html/volunteers/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘https://voluntee…’, Array)
    #2 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members-user.php(119): apply_filters(‘wpmem_login_red…’, ‘https://voluntee…’, 1)
    #3 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(714): WP_Members_User->login()
    #4 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(690): WP_Members->get_regchk(‘login’)
    #5 /home/alzniag/public_html/volunteers/wp-inclu in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php on line 5
    [08-Sep-2020 15:41:20 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_login_redirect(), 2 passed in /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php:5
    Stack trace:
    #0 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(287): my_login_redirect(‘https://voluntee…’, 1)
    #1 /home/alzniag/public_html/volunteers/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘https://voluntee…’, Array)
    #2 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members-user.php(119): apply_filters(‘wpmem_login_red…’, ‘https://voluntee…’, 1)
    #3 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(714): WP_Members_User->login()
    #4 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(690): WP_Members->get_regchk(‘login’)
    #5 /home/alzniag/public_html/volunteers/wp-inclu in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php on line 5
    [08-Sep-2020 15:47:26 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_login_redirect(), 2 passed in /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php:5
    Stack trace:
    #0 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(287): my_login_redirect(‘/profile/’, 284)
    #1 /home/alzniag/public_html/volunteers/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘/profile/’, Array)
    #2 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members-user.php(119): apply_filters(‘wpmem_login_red…’, ‘/profile/’, 284)
    #3 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(714): WP_Members_User->login()
    #4 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(690): WP_Members->get_regchk(‘login’)
    #5 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(2 in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php on line 5
    [08-Sep-2020 15:50:27 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function my_login_redirect(), 2 passed in /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php:5
    Stack trace:
    #0 /home/alzniag/public_html/volunteers/wp-includes/class-wp-hook.php(287): my_login_redirect(‘https://voluntee…’, 1)
    #1 /home/alzniag/public_html/volunteers/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘https://voluntee…’, Array)
    #2 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members-user.php(119): apply_filters(‘wpmem_login_red…’, ‘https://voluntee…’, 1)
    #3 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(714): WP_Members_User->login()
    #4 /home/alzniag/public_html/volunteers/wp-content/plugins/wp-members/includes/class-wp-members.php(690): WP_Members->get_regchk(‘login’)
    #5 /home/alzniag/public_html/volunteers/wp-inclu in /home/alzniag/public_html/volunteers/wp-content/themes/dt-the7-child/functions.php on line 5

    Hi – that didn’t help. I also restarted the browser. Using Chrome.

    Thread Starter morality28

    (@morality28)

    thanks – definitely my theme. Guess I’ll delve into the styles!

    Thread Starter morality28

    (@morality28)

    Now that I look at the image I also noticed something else – why would the time of the event on Feb. 14 not be lined up with all the other times?

    Hi – I tried modifying the css as you showed but I am still getting the same issue.

    Thread Starter morality28

    (@morality28)

    I’m not sure…but I have the latest version installed right now

    Thread Starter morality28

    (@morality28)

    Great…thanks!

    Thread Starter morality28

    (@morality28)

    Another update – I tried deleting the “Display Name” for my extra field but it will not allow this field to be blank – it automatically fills it in with the “Name” field (and capitalizes the first letter).

    Thread Starter morality28

    (@morality28)

    I was just thinking – another way around this would be if the extra field ‘Display Name’ did not show up if the extra field was left blank.

    Thread Starter morality28

    (@morality28)

    Thanks – I found the culprit elsewhere in my stylesheet (I was styling all img tags for my custom post type)

    Thread Starter morality28

    (@morality28)

    Doh…..perfect thanks!

    Thanks for the help

    Thread Starter morality28

    (@morality28)

    Okay – I have added in the code to my template:

    if( $wp_query->have_posts() ) : while( $wp_query->have_posts() ) : $wp_query->the_post();
    $catalyst_loop_count++;
    $more = 0; ?>
    
    <div <?php post_class(); ?>>
    
    print apply_filters( 'taxonomy-images-list-the-terms', '', array(
        'image_size'   => 'detail',
        'taxonomy'     => 'eligibility',
        'after'        => '</div>',
        'after_image'  => '</span>',
        'before'       => '<div class="icon">',
        'before_image' => '<span>',						) );

    And what I see on the page is this:
    https://i658.photobucket.com/albums/uu310/morality28/codesample.jpg

    Like I said I’m very new to this so I’m not sure what I’m doing wrong?
    Thanks for your help!

    I would think it depends on the template designer, but from my experience most paid templates have their own custom backend to make these types of changes to the theme.

    I would recommend trying a free template available from one of the paid sites to see if their themes work for you. For example I know that woothemes provides free templates that you could try out before buying one.

    There are more and more paid frameworks that allow you full customization without having to know any coding. Headway, for example, has a completely drag and drop interface.

Viewing 15 replies - 1 through 15 (of 28 total)