WordPress Access allowed to fewer pages till user logs in

You could try the Members plugin to restrict access to certain pages, very handy. In the menu section you can check if user is logged in, and show extra menu items if logged in by adding code similar to this in your template if ( is_user_logged_in() ) { wp_nav_menu( array( ‘theme_location’ => ‘logged-in-menu’ ) ); … Read more

How to limit character length in BuddyPress function output [closed]

I think buddypress has a get* version of that function that returns the value instead of showing it on the screen. So just cut the returned string after a certain amount of characters, like 50: $profile_bio = bp_get_member_profile_data( ‘field=Brief Biography’ ); if(strlen($profile_bio) > 50)) $profile_bio = substr($profile_bio, 0, 50).’…’; echo $profile_bio; If there’s no get … Read more

Include default functions and methods

Put this code in the top of your api page, it will call in the functions, but you need to tell wordpress NOT to try and draw a page as well define(‘WP_USE_THEMES’, false); // Tell wordpress not to draw out a page require(‘/path/to/public_html/wp-load.php’); // load wordpress functions