Forums

El-Aleph customizing the profile page (2 posts)

  1. phases
    Member
    Posted 1 year ago #

    Howdy again,
    I am not sure how to set the profile page for the El-Aleph plug in to show posts for only specific users (contributors, editors, and admin) and not for others (subscribers).

  2. squattingturnip
    Member
    Posted 1 year ago #

    It looks like you want to actually display the posts on the profile page, but you should be able to modifiy this code I wrote to show a link to a list of posts:

    <?php
    							// Get the WordPress user ID for this person's profile page.
    							 $userID = aleph_get_user_ID(); 
    
    			// Get the number of posts associated with that user ID and test to see if they have any (in other words, test if
    			// their post count is equal to 0. If it is...
    			  if ( get_usernumposts($userID) == 0 ) {
    
    			  // ...Then do nothing.
    
    			  				}
    			 // ...But if there are posts associated with that user ID (the earlier if statement returns "false", then print
    			 //the following code:
    				else {
                             // You would put your post loop here.
    				$caption = 'view posts';
    				echo '<span id="posts_link">(';
                    aleph_the_user_posts_link($caption);
    				echo ')</span>';
    				}
    				?>

    Of course, this assumes that what you want to do is show posts for people that have them, and not show anything for people that don't. If you want to actually do it based on user level, you could probably use this code:

    <?php
    // Get the WordPress user ID for this person's profile page.
    $userID = aleph_get_user_ID();

    $user_info = get_userdata($userID);
    $user_level = $user_info->user_level;

    if ($user_level >= 6) { //Or whatever you want to be the minimum user level for showing posts

    // Run your post loop.

    )
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags