Allow users to search for other users in Wordpress Frontend -
i have plugin i've created within site, shows 1 page i'm calling users , specific information users.
would possible allow users search other existing users front end of site?
this kind of thing i've got going on @ moment, haven't been able find kind of search of sort of thing, if point me in right direction it's appreciated,
i haven't included code it's not relevant really, can include if needs be,
thanks in advance!
http://focusedlearning.hcrlaw.com/courses-admin/
<?php $total_users = count_users(); $total_users = $total_users['total_users']; $paged = get_query_var('paged'); $number = 20;?> <?php $args = array( 'order' => 'asc', 'orderby' => 'display_name', 'count_total' => 'true', 'role' => 'subscriber', 'offset' => $paged ? ($paged) * $number : 0, 'number' => $number, );?> <?php $blogusers = get_users($args);?> <?php // array of wp_user objects. foreach ( $blogusers $user ) {?> <?php $userid = $user->id;?> <?php echo '<input type="text" value="' . esc_html( $user->display_name ) . '">';?> <div id="content"> <h2>completed courses</h2> <!-- compliance--> <?php $post_args = array( 'post_type' => 'tribe_events', 'eventdisplay'=>'custom', 'start_date' => date( 'y-m-d h:i:s', strtotime( '-365 days' ) ), 'tax_query' => array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => 'compliance', ), ), 'meta_query' => array( array( 'key' => 'associated_people', 'value' => '"' . $userid . '"', // matches exaclty "123", not 123. prevents match "1234" 'compare' => 'like' ) ) ); ?> <!-- membership --> <?php if( rcp_is_active() && 2 == rcp_get_subscription_id() ) : ?> <?php $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <tr> <td>compliance</td> </tr> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); ?> <tr> <td><a href="<?php the_permalink();?>"><?php the_title(); ?></a></td> <td><?php the_field('cpd_credits'); ?></td> </tr> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <?php $total_credit = 0; $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); $cur_credit = get_field('cpd_credits'); $total_credit += $cur_credit; ?> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <tr> <td <?php if($total_credit >= 2): ?> style="background-color:#009137;" <?php endif; ?> <?php if($total_credit < 2): ?> style="background-color:#f50c1a;" <?php endif; ?>> total: <?php echo $total_credit;?> of 2 in last 12 months </td> </tr> </table> <?php endif; ?> <!-- end of membership --> <!-- membership b --> <?php if( rcp_is_active() && 3 == rcp_get_subscription_id() ) : ?> <?php $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <tr> <td>compliance</td> </tr> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); ?> <tr> <td><a href="<?php the_permalink();?>"><?php the_title(); ?></a></td> <td><?php the_field('cpd_credits'); ?></td> </tr> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <?php $total_credit = 0; $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); $cur_credit = get_field('cpd_credits'); $total_credit += $cur_credit; ?> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <tr> <td <?php if($total_credit >= 2): ?> style="background-color:#009137;" <?php endif; ?> <?php if($total_credit < 2): ?> style="background-color:#f50c1a;" <?php endif; ?>> total: <?php echo $total_credit;?> of 2 in last 12 months </td> </tr> </table> <?php endif; ?> <!-- end of membership b --> <!-- membership c --> <?php if( rcp_is_active() && 4 == rcp_get_subscription_id() ) : ?> <?php $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <tr> <td>compliance</td> </tr> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); ?> <tr> <td><a href="<?php the_permalink();?>"><?php the_title(); ?></a></td> <td><?php the_field('cpd_credits'); ?></td> </tr> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <?php $total_credit = 0; $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); $cur_credit = get_field('cpd_credits'); $total_credit += $cur_credit; ?> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <tr> <td <?php if($total_credit >= 2): ?> style="background-color:#009137;" <?php endif; ?> <?php if($total_credit < 2): ?> style="background-color:#f50c1a;" <?php endif; ?>> total: <?php echo $total_credit;?> of 2 in last 12 months </td> </tr> </table> <?php endif; ?> <!-- end of membership c --> <!-- membership d --> <?php if( rcp_is_active() && 5 == rcp_get_subscription_id() ) : ?> <?php $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <tr> <td>compliance</td> </tr> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); ?> <tr> <td><a href="<?php the_permalink();?>"><?php the_title(); ?></a></td> <td><?php the_field('cpd_credits'); ?></td> </tr> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <?php $total_credit = 0; $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); $cur_credit = get_field('cpd_credits'); $total_credit += $cur_credit; ?> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <tr> <td <?php if($total_credit >= 2): ?> style="background-color:#009137;" <?php endif; ?> <?php if($total_credit < 2): ?> style="background-color:#f50c1a;" <?php endif; ?>> total: <?php echo $total_credit;?> of 2 in last 12 months </td> </tr> </table> <?php endif; ?> <!-- end of membership d --> <!-- membership e --> <?php if( rcp_is_active() && 6 == rcp_get_subscription_id() ) : ?> <?php $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <tr> <td>compliance</td> </tr> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); ?> <tr> <td><a href="<?php the_permalink();?>"><?php the_title(); ?></a></td> <td><?php the_field('cpd_credits'); ?></td> </tr> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <?php $total_credit = 0; $post_list = new wp_query( $post_args ); ?> <table style="width:100%"> <?php if( $post_list->have_posts() ) : while( $post_list->have_posts() ) : $post_list->the_post(); $cur_credit = get_field('cpd_credits'); $total_credit += $cur_credit; ?> <?php endwhile; else : ?> <?php endif; wp_reset_query(); ?> <tr> <td <?php if($total_credit >= 2): ?> style="background-color:#009137;" <?php endif; ?> <?php if($total_credit < 2): ?> style="background-color:#f50c1a;" <?php endif; ?>> total: <?php echo $total_credit;?> of 2 in last 12 months </td> </tr> </table> <?php endif; ?> <!-- end of membership e --> <!-- end of compliance-->
Comments
Post a Comment