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?
Assuming the file you're wanting to include the header in is in the same directory as header.php, then you can use
<?php include(__DIR__.'/header.php'); ?>
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
Related
Is it possible to rename or redirect the plugins/child[] directories to change plugin names for Google or source code view?
Wordpress obviously relies on wp-content and it's children to run, but I'm curious if it's possible to rename the children of plugins using .htaccess or another means.
I've experimented with variations this:
`Redirect 301 /path/to-old-url http://www.yourdomain.com/path/to-new-url`
...but that comes back to an actual redirect header response which I can't have.
I'm hoping it can be done and still have Wordpress function and update themes and plugins normally, but I'm not that savvy using .htaccess and I've blanked my site several times trying different things.
Any pointers or help would be really appreciated. :)
EDIT: What I'm trying to do is change the visible plugin/child directory name only. Not change the directory Wordpress accesses for plugins/name - having the revised plugin/name visible is not a problem.
OK, add this in wp-config.php, and it should do what you need, replacing 'apps' with the directory you want to serve from, and moving the plugins to the same directory on the server.
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/apps' );
define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/apps' );
(Initial responses before fully understanding the question.)
Not really.
You could use this WP Hide & Security to hide the plugin path /wp-content/plugins/ and rewrite that to something else, e.g., /apps/ ...but the NAMES of the plugins would still be visible.
The only way I could think of not showing the plugin names would be to directly include them in your theme via php includes, and strip out all the css/js that the plugin adds and incorporate that into your theme.
However, that likely would break the plugin, and even if you could get it working correctly, there would be now way to update said plugin in the future....(and of course that would make your site terribly hard to support so it's not recommended at all.)
I have a fully functional Wordpress custom theme. I have just installed Woocommerce and followed this guide. I have followed the very basic instructions to copy page.php, rename it and modify the loop. I have done this and am able to use Woocommerce, however in the page.php file, I have a
<?php get_header(); ?>
command, which successfully displays that part of the layout in my normal wordpress pages. However, in the direct clone which is now called woocommerce.php, it is not working fully, The links show up, but without any of the associated css which is linked into the header file. Any ideas why two versions of the same file would mean only one correctly imports / interprets the css?
Here are the two web pages:
http://www.gas-sense.co.uk/blog
http://www.gas-sense.co.uk/blog/product/gas-sense-personal/
OK, I have fixed this now. It was a dreamweaver issue, when cloning the file and renaming it, dreamweaver didn't seem to catch up with updating the links. I have since manually rewritten the references and it is working, thank for your help!
I am using a wordpress theme which I have modified a bit, based on the "Revera" Wordpress theme.
I have used it on other sites and it has worded fine. However, I have always installed it in the root of the domain. This time I have installed it on http://www.gas-sense.co.uk/blog
It isn't generating the usual homepage layout ( see http://www.georgeedwards.co )
Just wondering if the themes are typically setup to trigger the homepage layout? and if that is defined in a particular section of the php ?
The root folder is not a problem, you probably didn't set up the site url correctly, read the docs bellow
https://codex.wordpress.org/Changing_The_Site_URL
I've been working on a webpage and I wanted to break it out into templates that I could pull in. For example the navbar is common to all of the webpages so it gets pulled in like this.
<?php include("templates/navigationBar.html"); ?>
As soon as I move the code out of the index.php into the templates directory IntelliJ LiveEdit plugin stops updating the main index.php (that's including stuff from the templates directory) when I make changes to one of the templates.
I figure this is because the IntelliJ IDE is "stupid" and will only tell the plugin to refresh the page when it exactly matches the page I'm working on. Is there any way to map those notifications from my templates folder into any php file that might include them?
http://confluence.jetbrains.com/display/WI/LiveEdit
http://plugins.jetbrains.com/plugin/?null&pluginId=7007
I have made a website (WP based) and put every stuff inside the /site folder.
I did that, thinking of creating "custom" systems, and putting each one inside a folder, so for example: /promo would go to something else than the website...
But, I have tried with both .htaccess redirect and PHP location redirect, and when I try to "share" the website, without it's /site folder included, Facebook doesen't detect's the site meta...
Also, is it a problem for google, to use redirect's when accessing the website without the /site WP home folder? I mean, a guy comming from a www.onesite.com would have it's "referer" header as onesite, or mysite?
Thanks
I feel like you're creating your own problems. Just put WordPress in document root and don't bother with rewriting to a subdirectory. WordPress won't delete any custom files or folders when updating.
If you have some custom part that you want to reach through http://www.example.com/promo. Put it in the promo folder under the document root.
If want to reach the custom part through http://promo.example.com, just create new virtual host.