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条)

报告相同问题?

悬赏问题

  • ¥20 数学建模数学建模需要
  • ¥15 关于#lua#的问题,请各位专家解答!
  • ¥15 什么设备可以研究OFDM的60GHz毫米波信道模型
  • ¥15 不知道是该怎么引用多个函数片段
  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline