Forums

get_query_var and permalinks (4 posts)

  1. roffel
    Member
    Posted 3 years ago #

    Hi,

    Question about the get_query_var function and the use of permalinks.

    For a very simple website I use the index file (only) as a template-file (no header/footer/sidebar). In this index file I use some simple code to get the page_id (following this topic: http://wordpress.org/support/topic/209146?replies=3):

    When permalinks are off this works ok:
    $pageid = get_query_var('page_id'); (giving me the current page id)

    When pretty permalinks are on this doesn't work anymore (only the homepage, which I put as I static page in the admin, gives me a pageid of "3", the other pages are all giving back a "0")

    As mentioned in the topic above my method should work - with(out) permalinks enabled. But this is not the case, since I can get the "pagename" out of this function when permalinks are switched on.

    I'm a bit confused... what am I doing wrong? Is there an alternative for get_query_var? (this seems to be a very useful function in my opinion..)

    Some help/further info would be great!

    Thanks,

    Rolf

  2. Aviram Segal
    Member
    Posted 3 years ago #

    I got the same problem on 2.7.1 (NextGEN gallery nggpage var doesn't pass thru)
    Did you resolve this somehow ?

  3. roffel
    Member
    Posted 3 years ago #

    Nope! (Holidays didn't let me ;) )

    If I know more, I let you know...

    nyone else? Workarounds? Is this a WP 2.7.1 issue?

    Cheers

  4. roffel
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic