XenForo xenforo api | code output on top?

S

szymme

Guest
Hello xenforo, love you all. I hope you are a wordpress pro.

I installed Worpress and want to the show user id inside wordpress page. I use this code
<?php

require('forum/src/XF.php');
\XF::start('/hc');
$app = \XF::setupApp('XF\Pub\App');
$s = $app->session();
$uid = $s->get('userId');
if ($uid){
$finder = \XF::finder('XF:User');
$user = $finder->where('user_id', $uid)->fetchOne();
echo($uid);
}else{
echo 'guest';
}

?>

It works fine , love my life. But the problem is the...

Read more

Continue reading...