New answers tagged static
The reason you get 0 back is because of the test at the end of the function: if ( ! empty( $query->posts ) && $query->is_singular ) return $query->post->ID; else return 0; The posts page doesn't pass the is_singular test so 0 is returned. If you have a URL and want to know if it's the posts page, you can match it against the ...
Take a look a this function, it may be useful. WP function get_page_by_path()
Use the File Manager from cPanel or use a FTP account, and easily create your folder wherever you want and then direct the user with its real path something like: http://example.com/code/somepath/index.html It should work. :)
Well, for code samples, you can't beat putting them in a Git repository, then just putting a link into your posts. For public Gits, you could use Github or Bitbucket. Like this: https://bitbucket.org/Hitman007/crg_login/src
Top 50 recent answers are included