• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Infinity Pro – Conditional tags for front page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Infinity Pro – Conditional tags for front page

This topic is: resolved

Tagged: conditional tag, is_front_page

  • This topic has 2 replies, 2 voices, and was last updated 3 years ago by alnitak.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 5, 2019 at 8:59 am #492824
    alnitak
    Participant

    Hi

    I have an infinity pro theme.
    I have a problem with the homepage. I use the page with widgets (in order to make it like the demo) and so I used these settings on settings> reading: your homepage displays "your latest posts".

    I would like to use a conditional tag to make some changes only on the front page.
    I have used tags like that:
    if( is_page('front-page') ) ;
    if (is_home());
    id (is_front_page());

    but no one works.

    can you tell me how can I do?

    I'm working locally at the time.

    thanks!

    http://local
    August 5, 2019 at 9:02 am #492825
    Brad Dalton
    Participant

    Try

    if ( is_front_page() )

    After the function name in your code.

    Example:

    add_action( 'loop_start', 'your_function_name' );
    function your_function_name() {
    	
        if ( is_front_page() ) {
    
        echo 'Hello World';
    
        }
    
    }
    

    Also note : If you add code directly in your front-page.php file, no need to add the conditional tag as the code in the template only executes when the front page is loaded.


    Recent Client work

    August 5, 2019 at 10:02 am #492827
    alnitak
    Participant

    Hi Brad,

    thanks for the tips.

    I have noticed that is_front_page(); works, the function I have created instead is not working so I have to check it out.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Infinity Pro – Conditional tags for front page’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble