Thanks Zota. here:
function qbt_query_result_from_post() {
$reg_no = $(want to set to current logged in user’s username);
if(!empty($reg_no))
query_posts( array(
‘post_type’ => ‘qbt_calls’,
‘meta_query’ => array(
array(
‘key’ => ‘_qbt_register_no’,
‘value’ => $reg_no,
)),
‘posts_per_page’ => 1
)
);
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class=”qbt-result” id=’qbt-results’> …
$reg_no is the variable i want to set the current username to.
the key, _qbt_register_no is a variable in custom post(qbt_calls) which is also the same
as the username of the current user.
Right now on the custom post page, the users enter their username (assigned as $reg_no), hit enter and the query runs.
Rather than the users entering in their username manually in the custom post page and processing the query,
I want to call it automatically when they are logged in and process the custom post page result for the current user.
So the problem is setting the $reg_no to the current logged in username. thanks for your reply.