Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Reply to Thread

Post a reply to the thread: Wordpress .php Where to put if statements?

Your Message

Click here to log in

How many letters in the word Rabroad

 
 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Rate Thread

You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.

Topic Review (Newest First)

  • 05-08-2013, 09:43 AM
    Stjerne

    Wordpress .php Where to put if statements?

    Hi, everyone. I want to make a small script that makes something on the page, in this instance it will be a login form, appear on the home page, but disappear on any of the other web pages. Is there an easier way to do this than adding/altering code?

    From what I understand, I should use this piece of code in a conditional statement:

    is_front_page()

    Perhaps something like this:

    if ( is_front_page() ) {
    ...show login.
    }
    else {
    ...remove login.
    }

    Although I really don't know what to put in that code, and how I can use it while using a Child theme in the process. Does anyone know how I can do this?

    Thanks!

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •