• Is https://whereever/blog/index.php?p=0 a valid way to get the ‘default’ post selection that would be set for https://whereever/blog.

    I have set up a home.php that is similar to sidebar.php in content. I then have a link to what would normally be the default blog content. Obviously it’s a link to …/index.php?p=0.

    I use if( ‘0’ == $_Get[‘p’] ) to figure out which way to display home.php.

    It works but, is there anyone that knows if it’s “supposed” to work or is there a better(documented) way to achieve the same result? I just don’t want to depend on something that is sure to fail soon because I really don’t understand yet how WordPress works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • https://codex.www.ads-software.com/Linking_Posts_Pages_and_Categories

    Tells you how to link to various posts, Pages and categories.

    Thread Starter dlgreene

    (@dlgreene)

    Thanks-
    I saw that but, it still does not specifically document post 0(zero). I figured it out by seeing “index.php?p=0&paged=2” for paged posts for the “default” post selection.

    I surmised and then found that p=0 is currently the default post selection if for index.php. Does post 0 mean all posts currently selected by default for index.php/home.php?

    I have to assume that the indexing for posts is 1(one) based and not 0(zero) based and this behavior will continue because post zero is not a single post but, the default post selection for a variety of technical reasons. ?

    Thanks—

    I guess you could say ?p=0 is the equivalent of using ?p= or assigning a non-numeric value, which will just cause WordPress to retreive the default page (consider it the fallback).

    For pagination it doesn’t much matter what the query and value are. If you passed an unrecognized query type (?foo=bar), WordPress would perform the same as with a p (or just about any known) query that does not pass a “proper” value.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘index.php?p=0’ is closed to new replies.