Author template hiding the url field if user has no posts
-
Hi all!
In my theme I have a custom profile page where the authors can provide their url but I want to allow authors to post a url only if they have published at least a post.
This is the on wich the url field is called:
‘<input type=”text” name=”url” id=”url” value=”<?php echo esc_attr($current_user->user_url) ?>” />’And I was thinking hiding it by using a simple function like is_user_logged_in and adding some parameter to check if they have posts but the function wont accept any…
It would be something like
‘if ( is_user_logged_in and user has posts =>0
<input type=”text” name=”url” id=”url” value=”<?php echo esc_attr($current_user->user_url) ?>” />
} else {
NONE
}’Can some someone give me a light on this?
Thanks in advanced!
- The topic ‘Author template hiding the url field if user has no posts’ is closed to new replies.