Jump to content

Show latest WordPress posts in footer of WHMCS


Recommended Posts

Hi,

 

I've been trying to show the last 3 posts from our blog in the footer of our WHMCS pages however do not seem to be having much luck.

 

I've got the code from the WordPress codex in an external include file as this is used on our non-WHMCS pages too.

 

If I try to include this file with the smart {include_php file=""} it seems to break thr WHMCS layout, outputs an error (below) and causes the page URL to have /wp-admin/install.php appended to the end of it.

 

Fatal error: Call to a member function register_handler() on a non-object in /home/********/public_html/blog/wp-includes/media.php on line 1308

 

Has anyone been able to get WordPress posts to show within their smarty templates?

Link to comment
Share on other sites

I think he has the method of getting the posts, he is just having trouble displaying on the whmcs pages.

 

Maybe try this:

 

{php}

include('/path/file.php');

{/php}

 

Or you could take the content of file.php and put it all inside {php} {/php}

Link to comment
Share on other sites

Hi,

 

Thanks for the replies, I have the code to show the posts in the include file it just does not play nicely with WHMCS and the Smarty Templates.

 

@Gears I;ve tried both the include methog you posted above and pasting the PHP code into the page between the {php}{/php} but still generates the same error as using the smarty php include method.

Link to comment
Share on other sites

  • 3 weeks later...

Did you ever get this to work? I'm trying to do the same thing with the same result... thanks in advance!

 

Hi,

 

Thanks for the replies, I have the code to show the posts in the include file it just does not play nicely with WHMCS and the Smarty Templates.

 

@Gears I;ve tried both the include methog you posted above and pasting the PHP code into the page between the {php}{/php} but still generates the same error as using the smarty php include method.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated