szymme
Member
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 userid is not showing inside the code block (with php snipped addon)....
The user id is printed on top of the page???? why??? i want to print it at the place i put the code block.#

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 userid is not showing inside the code block (with php snipped addon)....
The user id is printed on top of the page???? why??? i want to print it at the place i put the code block.#
