Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #484053


    I am trying to load my custom plugin I have made only on the frontpage of my site. The issue is when I try to load it ether via page ID or by is_home() it will not work. For some reason the ID of the home page is always returned as 0 or “false”.

    Here is how I am getting the page id.

    $url = explode(‘?’, ‘http://’.$_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”]);
    $ID = url_to_postid($url[0]);

    Is there any recommendations you have that could help me with this. I am also running WPML, and only want the plugin to load on the primary home page not any of its translations, not sure if there is a way to do that or not.


    Hey vortexvalves!

    If your using a static page in Dashboard > Settings > Reading then try this.

    if ( is_home() || is_front_page() ) {



    this does not work, but was worth a try. To be a little more detailed, we are using a page from the enfold settings. So the theme is overriding the wordpress settings, I do not understand where or how.

    We set the page in Enfold Theme > Theme Options
    Frontpage Settings: and we set the static page here.

    Is there a way to know what is being referenced here for the themes settings page? I just need to know a way to reference this in the php code.

    If there is any other suggestions that would be wonderful.

    Thank you

    • This reply was modified 8 years, 11 months ago by Vortex Global.


    I’m sorry but I do not know what your trying to do. Perhaps something in the index.php file is what your looking for.

    The is_home() and is_front_page() should be working though. Where are you using them?

    Also, it would be best not to use a static page in Dashboard > Settings > Reading. You just need to set the front page in Dashboard > Enfold > Theme Options.

    Best regards,

    • This reply was modified 8 years, 11 months ago by Elliott.

    Got it figure out, I was hooking into the wrong action.

    I just wasn’t sure due to the theme setting its on frontpage, which is how we have it set up.

    Thank you for you time



    Glad you got it fixed :-)

    Best regards,

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Frontpage ID’ is closed to new replies.