• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Conditional Tag is_front_page() v/s is_home(). What to use?

Last Updated on February 5, 2019 Favorited: 1 times

While working with different niche site’s design, we got confused which conditional tag will work on a page especially when it is for terms homepage, frontpage.

This tutorial provides the idea of working with Conditional Tags For Home, Front & Blog Page. To understand the conditions, we will first understand those two pages and when we need them.

So here are the Visual Conditionals, The different types in Settings > Reading here. When shows.

Conditions:

Type 1

Your latest posts → is_front_page() and is_home() both will work.

URL → example.com

This setting is best if you don’t want to create a custom homepage and wants your posts shown on your homepage.

While both the conditional tag will work. It is recommended to use is_home() commonly use to target Post list page.

We can create, add and display anything using this conditional tag on this page.

Type 2

A static page having
a) Homepage: A Static Page. ONLY is_front_page() will work.
URL → example.com

b) Post Page: None (-Select-)

In this type, we have created a page name anything like Home, My Home and then we set it as Homepage in Settings > Reading.

We are not using the post page means we are not showing post list in any page.

This setting is recommended for those, who don’t have posts to show and want a custom homepage.

Most of the Business, SaSS sites use this setting and run their blog on a subdomain blog.example.com

Type 3

A static page having

a) Homepage: A Static Page (Frontpage) is_front_page() will work.
URL → example.com

b) Post Page: 2nd Page(Blog/post page) is_home() will work.
URL → example.com/blog/

It is the most Popular Reading setting in WordPress which enables both the feature custom homepage and a Post page in your site.

We have created two pages name anything like 1) Home 2) Blog and then we set it as Homepage, Post page in Settings > Reading.

This setting is recommended for those who want to design a custom homepage and want to show their articles on the post page.

This makes you clear that when a conditional tag will work on different Reading settings to do the stuff or function.

Important Read:

  • Conditional Tags in WordPress and Genesis Framework
  • Conditional Tags and Return Early in Genesis

Related Posts

  • Add Custom Body Class in Genesis
  • Conditional site footer in Genesis
  • Replace site footer widget area conditionally in Genesis
  • Customize Post Meta conditionally in Genesis
  • Customize Post info conditionally in Genesis

Categories: Free Content, Genesis Tutorials, WordPress Tutorials Tags: conditional tags, is_front_page(), is_home()

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service