Page 1 of 1

Page intro in wordpress

Posted: Mon Jan 24, 2011 7:33 am
by fabby
Hi guys!
How can i make an intro page in wordpress?. Without header and footer. First, when you acces the website, i want to appear the intro page, when you can select the language, and then, just to see the rest of the site (but the homepage not to be the intro.html, to be index.php, file that present the site, with header and footer).

Hope you understand what i want... :D
Thanks!

Re: Page intro in wordpress

Posted: Mon Jan 24, 2011 7:44 am
by fabby
What do you think about this solution.
In index.php i had put the code:

Code: Select all

session_start();
if(empty($_SESSION['ses_intro'])){
	include_once(TEMPLATEPATH.'/intro.php');
	die();
}
and in intro.php:

Code: Select all

<? session_start(); $_SESSION['ses_intro']="yes";?>
What do you say, is ok?

Re: Page intro in wordpress

Posted: Mon Jan 24, 2011 2:46 pm
by greyhoundcode
1. Partly as a matter of personal preference I would implement this as a plugin.

2. What if someone stumbles upon your website after a Google search, but they are directed to a specific post rather than the homepage?

If in a situation like this you still want them to be presented with the intro/splash page (and if you don't want to implement this functionality as a plugin) then the theme header file might be a better point at which to check if $_SESSION['ses_intro'] has been set.

Re: Page intro in wordpress

Posted: Mon Jan 24, 2011 2:47 pm
by Peter Kelly
Why don't you just install the wordpress under a directory then create a regular index page in the root ?

Re: Page intro in wordpress

Posted: Tue Jan 25, 2011 2:00 am
by greyhoundcode
Peter Kelly wrote:Why don't you just install the wordpress under a directory then create a regular index page in the root ?
Although that's a simple solution by itself I don't think it would help if he wants the intro/language selection to appear on the visitor's first access (just going by what the OP wrote here). For example, if the visitor went straight to www.blog.com/2011/01/random-post instead of www.blog.com on their first visit.

Personally, I would write a plugin for this as the functionality would then be independent of any future theme changes. In addition this would open up the potential for the "intro" to be a page that can be edited within WordPress, rather than having to go in via FTP and hard-code the changes or whatever.

My second choice would be to work it into the theme files (as the OP seems to be doing, and that might be a faster way of achieving the same thing if you are most comfortable working with theme files). By putting the check on $_SESSION['ses_intro'] within header.php it again means that the visitor can be intercepted on their first access, regardless of what URL it is they access on that first visit.
fabby wrote:First, when you acces the website, i want to appear the intro page, when you can select the language, and then, just to see the rest of the site (but the homepage not to be the intro.html, to be index.php, file that present the site, with header and footer).