I download [This][1] template and I added a template to (public_html/My_Host/templates) and change the Template from admin panel (Setup->General Settings->Template) but it does not work just six template work
I download the template from
[1]: https://colorlib.com/preview/theme/hostspace/
[2]: https://colorlib.com/
Did you downloaded WHMCS Templates ? (Note:Normal html5 templates never work as whmcs template ).
If yes, you need to upload and extract in "public_html/WHMCS_DIRECTORY/templates" .
Then it will list out in WHMCS "Setup->General Settings->Template" area.
Related
I created a page using elementor(named as: 'Error-page'), currently using linoor theme. What I want is to load this 'Error-page' via theme's default 404.php file (NOT using any plugin). Should I just type in 'include Error-page.php' in 404.php file to make it work?
Meta: My goal is to show my custom error page which I created using elementor(named as: Error-page) when invalid url is typed. One way of doing it is using plugin(I prefer not to do this for the time being), 2nd way could be somehow including this custom page in theme's default 404.php file
Note: Im new to wordpress
after thinking about your question, i have 2 solutions for you:
1. if you do not have code knowledge
This way is simple and safer, but have limits than other way - it's not using your template but redirect viewer to your template page. Any way, the same result
Build the 404 template with Elementor and publish it
Open your theme's 404.php file
In the very first top of the template file **(below <?php tag) paste this code:
wp_redirect( '/your-template-slug' );
exit;
Save it and you're done
2. If you have basic code knowledge:
This way is a litle complex, but it alow you to using not for 404 file - but other templates (archive, categories...)
Install "Anywhere Elementor" plugin
Build the 404 template as you do with Elementor
Get your template php shortcode
Edit the theme's 404.php file to echo out your template
In case you need more detail guide, i have record a step by step guide video here
I am new to WP, so please excuse if I ask anything silly.
I have WordPress site which have that created using builder and doesn't use page template of theme folder, everything is built on page builder. I also have other project that I've created on core php.
Is there a way to integrate Core PHP website with Wordpress website?
Creating a Page Template
Creating a page template is extremely easy. Create any new file in your theme (wp-content/themes/your-theme/my-custom-page.php) and start the file with a comment block like so:
<?php
/*
Template Name: My Awesome Custom Page
*/
get_header();
?>
/*
Code Here
*/
<?php
get_footer();
?>
You need paste php code inside this template file. When you submit for then redirection action will be page with custom template page.
Reference :
https://premium.wpmudev.org/blog/creating-custom-page-templates-in-wordpress/
Video :
https://youtu.be/1ZdHI8HuboA
I am using a custom CMS for a website that deals with 90% of the site's pages and content.
However, for the news/blog section of the site, I am using Wordpress.
I'm able to include the necessary Wordpress files to pull in posts to the main site, but cannot do the reverse.
I want to be able to call a php file into the header of Wordpress so I have access to the CMS's classes, primarily for navigation.
I've tried a search but can't seem to find an answer.
Additional Information:
Wordpress is installed in site.com/wordpress
The file I want to include is in site.com/includes
Clarification:
I don't want to create a custom template or include Wordpress functionality outside of Wordpress. I want to pull external classes from a CMS, which is a level above Wordpress, into Wordpress so that I can use it throughout the Wordpress installation.
You should go with custom page template.
Its an easy way to include php file in wordpress because in thisway you can easily include wordpress theme header and footer.
To create a custom page template.
You have to simply create new .php page and at start of page just include this code.
<?php
/*
Template Name: My custom page template name
*/
?>
// your code
To read in detail about Wordpress custom page template click here
I hope it will help you.
Method 1 :
<?php
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>
Method 2 :
<?php
define('WP_USE_THEMES', false);
require('./wp-load.php');
?>
I managed to fix this by altering the include line to reference the folder above the Wordpress root.
So, the line became require_once "../path/to/file" instead of just require_once "/path/to/file"
I want to use search module in my header.tpl file .
In that i used this code
{include file='./modules/blocksearch/blocksearch.tpl'}
But it's not working and by using this code my page gets blank.
Thanks in advance
Here you will find what you are looking for
http://www.ecartservice.net/prestashop-articles/1-4-plugins-revisited-part-1/
It is a great and easy way to call modules directly in template files, without the use of hooks. I tested it in both Prestashop 1.4 and 1.5 and it works.
For Prestashop 1.5, you will need to create 2 extra files in the "override" folder, as described in the link above:
Plugin.php in /override/classes/
FrontController.php in /override/classes/controller/
Then, you will be able to use in the template files the following code:
{plugin module='editorial' hook='displayHome'}
You need to use the hook's name (displayHome) and NOT the alias (home).
You cannot include a module template like this because the PHP code of te module is not called and the template needs it to set some Smarty variables.
The best you can do is to hook the blocksearch module to your header. Here we go :
Navigate to "admin > modules > positions"
Click on "Transplant a module" button
Select "Quick Search Block" for "Module"
Select ""Header of pages / displayHeader" for "Hook into"
Click "Save"
The "Quick Search module" is now hooked to your header.
I need to include a custom PHP page in Wordpress.
So what I need to do is just to show this custom php page using the Wordpress theme installed on that Wordpress.
Does not mind which theme is up, the custom php page will have to be shown under any theme is installed in that moment.
How do I do it in Wordpress?
I am new to Wordpress development.
Thanks
Creating a custom php page that will be able to be viewed in any theme (and have the theme applied) would be considerably difficult.
Each wordpress page calls specific theme functions of that particular theme, as well as referencing files of that theme to generate header, footer, css files, javascript files, etc.. Your custom page would need to plan for all of these contingencies, for each possible theme used.
Here's a alternative solution: inject PHP code directly into a standard wordpress page via this plugin http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/
Meaning: you make a normal wordpress page, but are able to add php to it. When this page is rendered, the proper page template is used, and all the theme references are taken care of for you.
You could do this easily with a page template. WordPress allows you to create page templates which can be assigned to a page via the 'Page Attributes' panel within the page editor. These templates are php files inside your theme directory which begin with some code like (see this page in The Codex for more info):
<?php
/*
Template name: Custom PHP Page
*/
?>
<?php // begin custom PHP page ?>
Typically a template is a variation on the regular theme files (such as page.php) and would call the get_header() and get_footer() functions and have an instance of the loop. However if you simply want to use a custom PHP page, then all you need to do is create the file you want inside the current theme directory and add the above code at the very top of the file.
To output the custom PHP page on your site, you would need to add a new page via the admin area and then assign your new page template to this page.
Alternatively, if you want to include a custom PHP page inside an existing theme file, you use the code:
<?php include(TEMPLATEPATH . '/includes/file.php'); ?>
in this case your custom PHP file would be located inside a directory called 'includes' within your current theme directory.
Tim.
It's not that difficult. Here's what you need:
Once you include the main wordpress blog header, the entire armamentarium of wordpress functions is available to you, which allows you to get the active theme's directory. Once you get that, just include the header and the footer of the theme.
// If title is not displayed before loading the header, Wordpress displays "Page not found" as the title
echo "<head>
<title>Your page title</title>
</head>";
// Include the Main Wordpress blog header
include $_SERVER['DOCUMENT_ROOT']."/wp-blog-header.php";
//Now, you need to get the active theme's folder, and get a relative path to that folder
$homeurl=home_url();
$ddir= get_bloginfo( 'template_directory');
$current_theme_relative_path=substr_replace($ddir, "", 0, strlen($homeurl));
//echo "<br/>The relative path to the currently active theme is ".$current_theme_relative_path;
//Once you have the path, include the header and footer, adding your custom php code in between.
// Include the specific theme header you need
include $_SERVER['DOCUMENT_ROOT'].$current_theme_relative_path."/header.php";
// Your custom PHP code STARTS here
// Add anything you want to display to the user
echo "
<h2>
Your form has been submitted
</h2>";
// END of custom code
?>
<?php
}
// Now end with the theme's footer
include $_SERVER['DOCUMENT_ROOT'].$current_theme_relative_path."/footer.php";
?>
Was very helpfull (even if dated of 2011-13)
Also, as a thank you, i'm sharing the version i made
it's usefull if your wordpress folder is not located at ROOT
PasBin Link - wordpress custom php page
just change the value of $wplocalpath in :
// Wordpress path (if wordpress is not located at ROOT
// $wplocalpath="/Wordpress1";