Forum Replies Created
-
function wc_custom_user_redirect( $redirect, $user ) { // Get the first of all the roles assigned to the user $role = $user->roles[0]; $myaccount = get_permalink( wc_get_page_id( 'myaccount' ) ); if( $role == 'child' ) { $redirect = bp_core_get_user_domain( $user->ID ); } } else { //Redirect any other role to the previous visited page or, if not available, to the home $redirect = wp_get_referer() ? wp_get_referer() : home_url(); } return $redirect; } add_filter( 'woocommerce_login_redirect', 'wc_custom_user_redirect', 10, 2 );
Gives me internal error.
Paul you are the man!
I have no idea either why that would work, however it did!
Thank you so much for your help.Hi Paul
You’ve been a great help!
I managed to find the correct buddypress index file.
If it isn’t too much I would like your help to one last thing.
So i created my div, however i want it to be visible to only the administrator.I found a code i can use:
<?php if (current_user_can(‘edit_users’)){ ?> <div class="opretbruger">Opret bruger</div> <?php } ?>
however it doesn’t seem to work – it simply hides the div for every user even though my administrator role has the right to edit users. I also tried with ‘administrator’. Am i doing anything wrong?
Hi Paul
Thanks a lot for your help. 🙂
I tried your suggestion, however the members directory look now changed. However i was able to insert my html/css, so that is good. What would i have to do in order to keep the look it was before and still be able to insert my html/css? I tried just inserting my html in the original folder, but it doesn’t seem to show.
See my comment. Forgot to do it as a reply.
Hi Paul
Sounds great. Yes i know how to some basic HTML and CSS – not very good at PHP. But where would i have to edit this file? Am i right if its in the child theme, so it won’t be overwritten when i update?