Adding shortcode to external splash page
-
Hi,
I want to display a splash page before my theme loads, I have figured out how to do that and I will post my code below, but what I also need to do is use shortcode on the splash page as well. I have come close to getting it, but not the cigar ??
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', false); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . '/wp-blog-header.php' ); require( 'wp-load.php' ); get_header(); echo do_shortcode('[wpgmza id="1"]'); get_footer(); ?>
So far, what I have found is that I need to have the get_header(); and get_footer(); code in place to get the shortcode working, but by using the header and footer, I am getting the whole look of the theme as well, I just want the background / blank page. Is there some way to do this?
NOTE: I don’t know if this is going to make a difference, most likely will, the code above is from the wordpress installation path, currently: /var/www/html/wordpress/index.php
I am going to use /var/www/html/index.php using .htaccess DirectoryIndex to specifiy my splash.php page like so:
.htaccess file:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress DirectoryIndex index.html splash.php
Thank you
Brian
- The topic ‘Adding shortcode to external splash page’ is closed to new replies.