I need to generate a unique ID number for each new member. I was going to use WP_query, but am not getting anything but an array.
I need to generate a unique ID number for each new member. I was going to use WP_query, but am not getting anything but an array.
If you want to display the info on the current user logged in you can use get_currentuserinfo
. [Codex]
Example from Codex
<?php global $current_user;
get_currentuserinfo();
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User email: ' . $current_user->user_email . "\n";
echo 'User first name: ' . $current_user->user_firstname . "\n";
echo 'User last name: ' . $current_user->user_lastname . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
echo 'User ID: ' . $current_user->ID . "\n";
?>
Or if you want display the info for a user that is not the current user logged in, you can use get_userdata
. [Codex]
The two links to the WP Codex should provide you with the syntax of the two functions. If you have any further questions or they did not work please ask.
I need to generate a unique ID number for each new member. I was going to use WP_query, but am not getting anything but an array. --------------Solutions------------- If you want to display the info on the current user logged in you can use get_curre
I am using Custom Metaboxes and Fields for Wordpress I am using the datetime_timestamp custom meta with a page. I am trying to echo the title of the page I am using the custom meta datetime in. But it is not working. I have the code incorrect. And I
I'm currently working my first plugin (to deal with my CPT) and am at the process of saving the values of a meta box. I wish to add an underscore (_) to the meta key so that it is hidden on the custom field part. I have some trouble to get the data s
I have a serious problem :) I have this code: <?php global $wp_query; $postid = $wp_query->post->ID; echo get_post_meta($postid, 'provinciadestacada', true); ?> And i want include here: <?php if ( in_category( '951' )) { echo 'Online'; } el
OK, so i'm messing with Custom Taxonomies for the second time and in both instances i've run into this problem where using the posts_per_page argument in either a query_posts or WP_query scenario.. basically, if i set a custom limit on posts per page
I am trying to implement a dry run kind of mechanism for my script and facing the issue of quotes getting stripped off when a command is passed as an argument to a function and resulting in unexpected behavior. dry_run () { echo "[email protected]" #printf '%q
Having a bit of trouble with an image upload custom meta box. What happens is the uploaded image is created as an attachment but the wp_handle_upload seems to kick back the error "Specified file failed upload test" rather than updating my post m
I am working on a PHP/MySQL application that uses a different time zone from the server it runs on, and neither of the timezones are UTC. I'm converting displayed times to be in the user's timezone, and am wondering whether my approach is sensible. I
I would like to suppress the output of one of my custom fields. Is there a way to do this using the <?php the_meta(); ?>command? --------------Solutions------------- The function, the_meta() allows you to hook to the the_meta_key filter (which curre
My category page navigation doesn't seem to be showing up at all, what am I missing in my coding? <?php get_header(); ?> <div class="inner-page"> <div class="page-spacer"></div> <!-- Content Start --> <
I have created a meta box and it's storing the post data successfully but I am having trouble outputting the content and displaying it in a sensible fashion - beyond my limited knowledge of PHP. I am a bee-keeper and want to record inspections of my
I'm using the following code to produce a wp_editor instance: <?php if (version_compare($wp_version, "3.3") >= 0) { ?> <p><?php wp_editor( $answer->post_content, 'answer', array( 'media_buttons' => true, 'wpautop' => t
How can I get a Previous / Next navigation that only navigates the child pages of the current page? By that i mean url.com/page/child1, url.com/page/child2 and so on.. I've been searching around alot but I'm still lost. It seems like you can't do tha
what I'm trying to do is add a new coloumn to Edit post page (done) and in that coloumn show data taken from a set of custom fields (partially done). This is my code (I use it as a plugin so it simpler to modify it). It adds the metabox in posts so I
Ok I have a wierd issue with custom meta boxes that I am at a loss for. I am using this class <?php class ARIXWP_Meta { private $meta = null; public $postid = null; private $template = null; function __construct() { add_action('save_post',array(&$t
Basically I need to add custom meta boxes to pages and one of this options must be a list of categories from previous posts. I've managed to add the metaboxes and wrapped the categories in a array, however there must be something I missing as on the
I'm having trouble finishing off this code that I adapted from Cosmoslabs excellent tutorial. Everything is working (listing and pagination etc) except the search function whic is returning nothing i.e. no users are listed when I try to filter by a k
I using post meta like.. $meta = get_post_meta(99,'_mymeta',true); $value = $meta['somekey']; echo $value; But how to update $meta['somekey'] to some another value ? How to use update_post_meta to update sub meta key ?(Idk, How ppl call) update_post_
I am working on meta fields for a custom post type storing match data. I have two sepearte meta boxes one which the team and the score are chosen and the values are submitted. The second takes that information and provides a series of select boxes in
I have disqus installed in my website. It adds dsq_thread_id meta. And while showing the post meta in post with tag; <?php the_meta(); ?> I want to hide dsq_thread_id in all posts. How can I do this? --------------Solutions------------- OK, just don