RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

WordPress Features on a non-WP Page

The following code will allow you to create your own random pages while utilizing the full features of your WordPress installation. All you'll have to do is copy the following code into a blank file with a PHP extension. You'll have to be careful to ensure you correctly reference the wp-load.php WP file.

1
<?php 
2
require( '../wp-load.php' );
3
4
echo 'This is content outside of WordPress';
5

This code will display the WP header, footer and the text, "This is content outside of WordPress". If you wanted to include basic HTML in your page without the PHP entanglements, you could use:

1
<?php 
2
require( '../wp-load.php' );
3

This is content outside of WordPress

1
<?php 
2
get_footer();

If you choose to use shortcodes in your non-WordPress page, you'll have to use the following (remembering you're outside the loop).

1
<?php 
2
$content = "Content outside WordPress [MyShortCode]";
3
echo do_shortcode($content);

You can add widgets and other features... and use any other components of WP as required. However, in most cases, the feature isn't much different to a blank WP page.

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment