Sujit Y. Kulkarni
Sujit Y. Kulkarni

Reputation: 1386

How to differentiate Front page and other pages in Wordpress?

I have created a front page (i.e index.php) with my own design. This page will contain

The problem is, I see index.php loaded correctly as a front page. But when I navigate to other pages like About or Contact, the respective content from these pages is not showing up. Instead what getting loaded there is, same what Index page has. I don't want slider or thumbnail appearing on these pages.

So how to tell wp that, this is my front page, and this is my About page, don't load a slider and stuff on About page!?

Upvotes: 0

Views: 293

Answers (4)

Mantroon
Mantroon

Reputation: 16

I usually create a front-page.php file, Wordpress will use that instead of index.php (which you can use as a generic template from then on).

Upvotes: 0

Anjana
Anjana

Reputation: 499

Make another template and set this template for your single pages. And then from backhand set it.

Upvotes: 1

Jobin
Jobin

Reputation: 8282

Try this ,

if( is_home() || is_front_page() ){
//your home page content
}
else{
//other pages

}

For more here

Hope its works..

Upvotes: 1

jogesh_pi
jogesh_pi

Reputation: 9782

use is_front_page() to determine the home page. like you only want slider on the home page then edit your header.php file that consist the slider part and do something like this

if( is_front_page() ):
// Front Page stuff like slider and 
// whatever you want
endif;

Upvotes: 1

Related Questions