Strange behaviour of is_user_logged_in() and get_current_user_id()

I’ve run your code and it works fine to me except for the inclusion in file-access.php: require_once($_SERVER[‘DOCUMENT_ROOT’].’/wp-load.php’); enable debug to see if there are errors depending on other issues and not regarding these specific code lines. But.. as per WP documentation: actions reference the earlier action hook where the authentication process is completed and cookies … Read more

IF user is logged in only show certain page

Big Question. So, first, to keep the galleries separate, it would be good to give them their own custom post type. We’ll be checking for this later… <?php add_action( ‘init’, ‘wpse32840_register_post_type’ ); function wpse32840_register_post_type() { register_post_type( ‘client_gallery’, array( ‘label’ => __( ‘Client Galleries’ ), // probably needs better lables ‘public’ => true, // allow people … Read more

Implementing an image hosting website using WordPress? [closed]

I would suggest you have a second look into BuddyPress and you’ll find that your requirements are matched. The awesomeness of BuddyPress means you can have plugins that extend BudyPress. For your requirement: I would like users to be able to post photos, arrange them in galleries/albums, comment/tag them, complete other custom fields relating to … Read more

I’m looking to add membership to my site, any plugins that would be compatible [closed]

Look at S2 Member http://www.s2member.com/ The s2Member® Framework is an extremely versatile & powerful (free) membership management plugin for WordPress®. The s2Member® Framework plugin integrates seamlessly with PayPal® Standard Buttons (very easy), and fully supports recurring billing, with the ability to track affiliate commissions on a recurring basis (through your choice of many affiliate platforms). … Read more

How to show different sub sites based on Member’s user name In word press?

There is a filter called login_redirect which you can use. The third parameter passed to this filter is the user object, so you have all kinds of possibilities to redirect. Like this: add_filter (‘login_redirect’, ‘wpse63660_redirect’, 10, 3); function wpse63660_redirect ($redirect_to, $request, $user) { //is there a user to check? if ( isset( $user->roles ) && … Read more

Stop the execution of foreach loop which extract data from array?

It has probably more systematical solution, but one option is to save the highest recipient ID, and then load only higher IDs next time. Something like this: (not tested) $last_id = get_option(‘last_recipient_id’); $rcvr_id = $wpdb->get_results( $wpdb->prepare(“SELECT ID FROM wp_users WHERE ID > %d ORDER BY ID “), $last_id ) ; foreach($rcvr_id as $rv_id) { $rcvr_id … Read more