Created
May 3, 2012 16:07
-
-
Save vicchi/2586834 to your computer and use it in GitHub Desktop.
Using do_shortcode in a WordPress template to show WP Biographia's Biography Box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display the Biography Box for the current user ... | |
echo do_shortcode ('[wp_biographia]'); | |
// Get the username of the currently logged in user ... | |
global $user_login; | |
get_currentuserinfo (); | |
// Within the WordPress loop get the username of the user whose post/page is current ... | |
global $post; | |
$user = get_userdata ($post->post_author); | |
$user_login = $user->user_login; | |
// Or you already know the username ... | |
$user_login = "fred"; | |
// Display the Biography Box for a specific user ... | |
echo do_shortcode ('[wp_biographia author="' . $user_login . '"]'); | |
// Display the Biography Box for all users | |
echo do_shortcode ('[wp_biographia author="*"]'); | |
// See http://www.vicchi.org/codeage/wp-biographia/4-shortcode-usage-and-support/ for all | |
// uses of the WP Biographia shortcode | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment