WordPress.org

Ready to get started?Download WordPress

Forums

is_home() not working (2 posts)

  1. Heritz
    Member
    Posted 7 years ago #

    Hello guys,

    I made a plugin for banner administration, you know advertising. I want to run that plugin only if I am visiting the main page, I mean the home page.

    I tried in my plugin file (its just one file) to use is_home() function, but it always returns FALSE. Do you guys have any ideas about why this happens? I mean, I've been reading lots of post in the net about this function and it seems not working as it should. I tried all the suggestions given in this forum and in the Google results, but I am always still getting FALSE with is_home() even if I am in the main page.

    Note: I have no home.php file. Thanks!

  2. vkaryl
    Member
    Posted 7 years ago #

    I'm not sure you can put the if is_home() function in the plugin itself. (Of course, I can quite certainly be wrong about that....)

    What I normally do is put the if is_home() function just before the plugin call.

Topic Closed

This topic has been closed to new replies.

About this Topic