dongshen3352 2015-11-14 18:29
浏览 59
已采纳

包括whmcs客户区中的wordpress标题

For a project I'm working on I am trying to accomplish to match the whmcs client area to my wordpress site. So far I've made a lot of progress but I'm stuck right now. I want to include the header of my wordpress site in whmcs. I tried to implement the static code of my header in the header.tpl file of whmcs. It kind of works but the css conflicts with the main theme of whmcs.

The second thing I tried was to include it with php

<?php include(path/to/header.php'); ?>

Since the header.php is located in the main www directory and whmc is on a subdomain, I was advised to try this:

include($_SERVER['DOCUMENT_ROOT'].'/header.php');

Neither of those two methods worked.

The next thing I did was a new approach. I tried implementing the whmcs layout in wordpress with a plugin called advanced Iframe. It does work but it doesn't always behave as it should and I think it is an better idea to keep whmcs completely on its own subdomain (client.domain.com)

I am no coding genius, so I'm stuck at this point. Are there any workarounds for this?

  • 写回答

2条回答 默认 最新

  • drj58429 2015-11-14 20:19
    关注

    I have found my mistake. Since whmcs themes are .tpl, php can't be included directly and is not recommended. What I did was create a new folder in the theme directory with all the assets and a header.tpl file. Then I included the header.tpl like this.

    {include file="$template/header/header.tpl"}
    

    The only downside is that I have to edit the menu manually when changes are made to the WordPress site

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法