• 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

Conditional tag of php code

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 › General Discussion › Conditional tag of php code

This topic is: not resolved

Tagged: entry-title, genesis_do_post_title, genesis_entry_header, page-title, post title

  • This topic has 8 replies, 3 voices, and was last updated 3 years, 1 month ago by Ronda007.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • August 4, 2020 at 1:28 pm #500440
    sashind
    Participant

    I have this code to bring title below featured image:
    //* Remove the entry title (requires HTML5 theme support)
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );

    //* Add back the entry title before the main content with priority
    add_action( 'genesis_entry_content', 'genesis_do_post_title' ,8 );

    I want this function to apply only to my homepage/post page. I don't want it to be active on singular post pages.
    How to apply a conditional tag or something to this code so that it only functions in the homepage and not the singular post page.

    http://slowequity.com
    August 4, 2020 at 9:28 pm #500447
    Brad Dalton
    Participant

    There is code for this. Please do a Google search.


    Tutorials for StudioPress Themes & WooCommerce.

    August 4, 2020 at 10:24 pm #500448
    sashind
    Participant

    I'M NOT ABLE TO APPLT THE CODE. THAT'S WHY I'M ASKING THE GROUP. COULD YOU PROVIDE THE EXCAT CODE? i'm NEW TO CODES

    August 4, 2020 at 10:30 pm #500449
    Brad Dalton
    Participant

    Another option is to add the code to a home.php or front-page.php file.


    Tutorials for StudioPress Themes & WooCommerce.

    August 4, 2020 at 10:41 pm #500450
    sashind
    Participant

    HOW TO USE THAT?

    August 4, 2020 at 10:43 pm #500451
    Brad Dalton
    Participant

    Using a code editor, create a file named front-page.php or home.php and add your code to the file after the opening php tag.

    <?php
    
    //* Remove the entry title (requires HTML5 theme support)
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    
    //* Add back the entry title before the main content with priority
    add_action( 'genesis_entry_content', 'genesis_do_post_title' ,8 );
    
    genesis();
    

    Tutorials for StudioPress Themes & WooCommerce.

    August 4, 2020 at 10:47 pm #500452
    sashind
    Participant

    LOL, I'M NEW TO CODES. I DON'T KNOW WHAT YOU MEAN WHEN U TELL ME TO OPEN A NEW FILE HAHA

    August 4, 2020 at 10:50 pm #500453
    Brad Dalton
    Participant

    You have 2 options:

    If your web host uses cPanel you can use file manager to edit/add files.

    Otherwise you'll need to install a code editor on your local computer. Try BBedit for Mac or Notepad++ for windows.


    Tutorials for StudioPress Themes & WooCommerce.

    August 5, 2020 at 5:01 am #500464
    Ronda007
    Participant

    hi
    I am Ronda, I want to add a login section on-site through PHP. I want to code for this anybody can help me?

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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