WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] What is the current page? (3 posts)

  1. dimitry
    Member
    Posted 9 years ago #

    I think I stumbled onto a function that will show what current page is loaded (index.php, single.php, etc.), but now that I actually need, I can't find it anywhere.

    This is what I've used in the past, but it's pretty weird way to go about things.

    // Get current page (easier way?)
    $curstr = $_SERVER['QUERY_STRING'];
    $curstr = explode("&",$curstr);
    $curpage = explode("=",$curstr[0]);
    $curpage = $curpage[1];

    Any help would be appreciated,
    Thanks

    Dimitry

  2. dimitry
    Member
    Posted 9 years ago #

    Actually, never mind, that code is completely irrelevant. Not what I want it to do. (It gets the slug of the current page.. I think)

    Dimitry

  3. dimitry
    Member
    Posted 9 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.