FPForum Posted November 27, 2007 Share Posted November 27, 2007 I am trying to include the php header from my wordpress in order to replace the header on whmcs. I have removed the whmcs header and background but it doesn't seam to be displaying my wordpress header.php....am I missing something? Can I include php in the tpl file? 0 Quote Link to comment Share on other sites More sharing options...
robbo Posted November 27, 2007 Share Posted November 27, 2007 Whats the include code you are using? If you are using <?php ?> tags, replace these with {php} and {/php} respectively. Eg: {php}include ('../head.php');{/php} 0 Quote Link to comment Share on other sites More sharing options...
FPForum Posted November 28, 2007 Author Share Posted November 28, 2007 thanks robbo. I tried that and instead get a complete blank white page (I cleared out my templates_c) this is my code: {php}include ('../wp-content/themes/hosting/header.php');{/php} 0 Quote Link to comment Share on other sites More sharing options...
robbo Posted November 28, 2007 Share Posted November 28, 2007 Are you able to tell me where the 2 sites (WHMCS and Wordpress) are located? The ../ at the front is just what mine has (the head.php is located one directory above my WHMCS) Sounds like it can't find the file, so it spits out a blank page which is normal for the WHMCS system. 0 Quote Link to comment Share on other sites More sharing options...
FPForum Posted November 28, 2007 Author Share Posted November 28, 2007 Are you able to tell me where the 2 sites (WHMCS and Wordpress) are located? The ../ at the front is just what mine has (the head.php is located one directory above my WHMCS) Sounds like it can't find the file, so it spits out a blank page which is normal for the WHMCS system. Certainly robbo. public_html/wp-content/themes/hosting/header.php --is where my header is located public_html/clients/templates/portal/header.tpl --is the header for my whmcs I'm also noticing, my wordpress displays just fine on my index page, but when trying to access the header this way: Here I am noticing I get an error..Would this make any difference? The header displays absolutely fine on my site, so I wouldn't think it would make a difference.. Thanks for your help robbo! 0 Quote Link to comment Share on other sites More sharing options...
robbo Posted November 28, 2007 Share Posted November 28, 2007 It looks like that could be causing the error. Possibly try, {php}include ('/home/user/public_html/wp-content/themes/hosting/header.php');{/php} Replace /home/user with your full address. This will rule out it not finding the file. If it doesn't work, you might just have to copy the source code and paste into the header.tpl Good luck. 0 Quote Link to comment Share on other sites More sharing options...
FPForum Posted November 28, 2007 Author Share Posted November 28, 2007 Thanks alot robbo. going to try that now! Would I also need the css information too if I copy the whole header file? 0 Quote Link to comment Share on other sites More sharing options...
robbo Posted November 28, 2007 Share Posted November 28, 2007 Yes you would, as there will be certain styles in the main page which aren't in the WHMCS template styles. 0 Quote Link to comment Share on other sites More sharing options...
FPForum Posted November 28, 2007 Author Share Posted November 28, 2007 Yes you would, as there will be certain styles in the main page which aren't in the WHMCS template styles. Thanks bud, still didn't work so i'm not exactly sure what I am gonna do. the furthest i've gotten was the original way, which gave me a white screen and all that shows up is the code upto the first bloginfo which is: <meta http-equiv="Content-Type" content=" I am thinking it must be because of the error I am getting in my header.php..It's really weird that the error shows up even though the header displays perfectly fine on my main page.. 0 Quote Link to comment Share on other sites More sharing options...
goddess_dix Posted January 5, 2009 Share Posted January 5, 2009 for anyone trying to do this, just including the header.php file won't work, because it's not initializing the wp variables, etc. that way. i found an approach that worked for me here - http://bloke.org/php/using-wordpress-header-and-footers-externally/ 0 Quote Link to comment Share on other sites More sharing options...
clbryan26 Posted January 7, 2009 Share Posted January 7, 2009 Not a coder, just an idea from my own design troubles... Copy the contents of your header file into another file local to your WHMCS directory, change the include calls in the new file you created, and use {literal} {/literal} tags at the start and end of that file? 0 Quote Link to comment Share on other sites More sharing options...
HostXLarge Posted February 10, 2012 Share Posted February 10, 2012 Trying to do the same and I will update you. @mycommon No, Literal tags are used for java script. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 10, 2012 Share Posted February 10, 2012 @mycommon No, Literal tags are used for java script. Literal tags are used for anything you want to escape from normal smarty markup. Specifically { and } characters. If you anticipate having any of them in normal text or code, you either need to wrap {literal} tags around it, or replace them with {ldelim} and {rdelim} Its not only for javascript, but thats commonly where you will see it. 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 7, 2012 Share Posted August 7, 2012 You can use [color=#333333]{include_php file='/path/file.php'}[/color] 0 Quote Link to comment Share on other sites More sharing options...
Jared Posted November 17, 2012 Share Posted November 17, 2012 An include isn't actually the best way to do this. I have a method that works a bit cleaner. Works with Joomla / WordPress, I'll post it if you wish. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted November 17, 2012 Share Posted November 17, 2012 Even though this thread is from 2007, someone might benefit from it. Might as well post it, as long as it's not some commercial solution. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.