Sign Up Sign Up

Have an account? Sign In Now

Sign In Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

Stack Question

Stack Question Logo Stack Question Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
Home/ Questions/Q 809
Next
In Process
Roshan22
Roshan22

Roshan22

  • Nepal
  • 127 Questions
  • 12 Answers
  • 1 Best Answer
  • 135 Points
View Profile
  • 0
Roshan22
Asked: February 16, 20212021-02-16T08:20:54+00:00 2021-02-16T08:20:54+00:00In: Computer

What is the PHP code to show content in WordPress front page only?

  • 0

I want to show few contents only in my WordPress home page. If it is not home page I would like to  hide the content. Please suggest me the PHP code of if is_front_page or it it is not front page condition.

only content in home pageshow content in front pagewordprss
  • 1 1 Answer
  • 345 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    1. edin

      edin

      • United States (US)
      • 42 Questions
      • 4 Answers
      • 0 Best Answers
      • 45k Points
      View Profile
      edin
      2021-02-16T18:07:28+00:00Added an answer on February 16, 2021 at 6:07 pm

      Sometimes we have to keep some content on the home page only and hide it from other link pages. I got the same issue a few months ago, but I solved it. I used the below code to show content on the WordPress home page only. You can try it once. Good Luck!

      <?php if ( is_front_page() ) { ?>
      Keep your content here that you want to show on the WordPress front page.
      <?php } ?>

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask A Question

    Questions Categories

    • Animal
    • Automobile
    • Business & Finance
    • Computer
    • Country
    • Education
    • Electronics
    • Entertainment
    • Fashion
    • Festival & Culture
    • Food
    • Game
    • Health & Beauty
    • History
    • Language
    • Lifestyle
    • Mobile
    • Movie
    • Music
    • Nature
    • Politics
    • Product
    • Reviews
    • Science
    • Sports & Fitness
    • Technology
    • Travel

    Explore

    • Recent Questions
    • Most Answered
    • Most Visited
    • Most Voted
    • No Answers
    • Questions For You
    • Polls
    • Followed Questions
    • Favorites Questions
    • Answers For You

    © 2021 StackQuestion. All Rights Reserved.
    Home | About Us | FAQs | Privacy Policy | Terms & Conditions | Disclaimer | Contact Us

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.