Get Name and other information of the current user of wordpres and Search your referrals

1

In my project in one of the pages of the backoffice that I created for the user is to see my referrals, I am using wordpress, and this referral page will be done by php since I have to make queries in the databases. / p>

I know that with this function I recover the variables that I want from the logged in user:

if (is_user_logged_in()){

            $cu = wp_get_current_user();


            echo 'Nombre de usuario: ' . $cu->user_login     . '<br />';


    }

In fact, I've put this in my php and it gives me an error, I do not know if I have to put this function in the functions and then pass it to another php or not?

The query and others know how to do it I need to get the logged-in user and with that I would do the query.

    
asked by AitorUdabe 03.10.2017 в 10:31
source

1 answer

0

It is already solved, I had to add this code on the page to be able to use it and visualize it.

<?php
/*
Template Name: visualizador de niveles
*/
?>
<?php

get_header();

$is_page_builder_used = et_pb_is_pagebuilder_used( get_the_ID() );

?>
    
answered by 03.10.2017 в 11:00