Registration Custom Fields not displaying
Viewing 2 Posts - 1 through 2 (of 2 total)
Author | Posts |
---|---|
April 20, 2013 at 7:17 pm 2619 | |
I have some custom fields for my Registration Form and I want to display those on my theme's 'author.php' page. I cannot get them to display the data using the syntax from the documentation. Is there a different treatment for registration form custom fields? I can get it working fine for regular forms on posts. <?php get_header(); ?> <?php $show_sidebar = (get_option('thestyle_sidebar') == 'on') ? true : false; ?> <h3>Location</h3> <?php echo get_post_meta( $post->ID, 'location', true ); ?> <h3>Website</h3> <a href="<?php echo get_post_meta( $post->ID, 'user-website', true ); ?>"><?php echo get_post_meta( $post->ID, 'user-website', true ); ?></a> <div id="content" class="clearfix<?php if ($show_sidebar && get_option('thestyle_blog_style') == 'false') echo(' sidebar-fixedwidth'); ?>"> <div id="boxes" class="<?php if (!$show_sidebar) echo('fullwidth'); if (get_option('thestyle_blog_style') == 'on') echo(' blogstyle-entries'); ?>"> <?php get_template_part('includes/entry'); ?> <?php get_footer(); ?> http://cookiehound.iwantedryanfarmer.com/author/testnametwo/ | |
April 20, 2013 at 7:56 pm 2620 | |
`get_post_meta()` is for posts, `get_user_meta()` is for registration or users custom field. One more thing, `$post->ID` refers to the post ID, where for authors profile, you need to get the user ID. To get the current users ID, add this code after `get_header()`: Now you can show the user location like this | |
April 20, 2013 at 8:14 pm 2621 | |
Perfect. Thank You! |
Viewing 2 Posts - 1 through 2 (of 2 total)