talhatc
07-18-2016, 10:23 PM
I am creating a Api Extension with the help of Wordpress Header & Footer Integation (https://vborg.vbsupport.ru/showthread.php?t=302307)
I am almost done and everything seems to be in order except, whenever I return a data, it always goes on the top of the browser, after the <body> tag, example given below:
class wpHeaderFooter_Api_Options extends vB_Api_Extensions
{
public $product = 'wpheaderfooter';
public $version = '1.0.0';
public $developer = 'me';
public $title = 'WordPress Integration Extension';
public $minver = '5.2.2';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 1;
public $extensionOrder = 10;
public function wpHeader($x){
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/wpfolder/wp-content/themes/mytheme/header-forums.php";
include_once($path);
return;
}
header-forums.php file simply contains an echo statement. VB displays it, but shows it on the top, even above the main-navbar-wrapper. However, the weird part is, if I do the following, it shows where the hook is supposed to show it
class wpHeaderFooter_Api_Options extends vB_Api_Extensions
{
public $product = 'wpheaderfooter';
public $version = '1.0.0';
public $developer = 'me';
public $title = 'WordPress Integration Extension';
public $minver = '5.2.2';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 1;
public $extensionOrder = 10;
public function wpHeader($x){
//$path = $_SERVER['DOCUMENT_ROOT'];
//$path .= "/wpfolder/wp-content/themes/mytheme/header-forums.php";
//include_once($path);
return "<h1>My Custom Footer</h1>";
}
Any help would be highly appreciated.
I am almost done and everything seems to be in order except, whenever I return a data, it always goes on the top of the browser, after the <body> tag, example given below:
class wpHeaderFooter_Api_Options extends vB_Api_Extensions
{
public $product = 'wpheaderfooter';
public $version = '1.0.0';
public $developer = 'me';
public $title = 'WordPress Integration Extension';
public $minver = '5.2.2';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 1;
public $extensionOrder = 10;
public function wpHeader($x){
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/wpfolder/wp-content/themes/mytheme/header-forums.php";
include_once($path);
return;
}
header-forums.php file simply contains an echo statement. VB displays it, but shows it on the top, even above the main-navbar-wrapper. However, the weird part is, if I do the following, it shows where the hook is supposed to show it
class wpHeaderFooter_Api_Options extends vB_Api_Extensions
{
public $product = 'wpheaderfooter';
public $version = '1.0.0';
public $developer = 'me';
public $title = 'WordPress Integration Extension';
public $minver = '5.2.2';
public $maxver = '5.9.99';
public $infourl = '';
public $checkurl = '';
public $AutoInstall = 1;
public $extensionOrder = 10;
public function wpHeader($x){
//$path = $_SERVER['DOCUMENT_ROOT'];
//$path .= "/wpfolder/wp-content/themes/mytheme/header-forums.php";
//include_once($path);
return "<h1>My Custom Footer</h1>";
}
Any help would be highly appreciated.