Forums

[resolved] permalink detection? (5 posts)

  1. coolkidsunion
    Member
    Posted 9 months ago #

    Hi there. I think I may be missing something and this may be super simple. Is there a built in function to detect whether the user is at a permalink page versus the posts page?

    Thanks.

  2. stvwlf
    Member
    Posted 9 months ago #

    Your question is not at all clear. How are you defining "permalink page" and "posts page"?

  3. coolkidsunion
    Member
    Posted 9 months ago #

    Hello.

    By permalink page I mean when the user clicks through to the full article...

    http://www.url.com/category/post

    from the post list page.....

    http://www.url.com

    I am trying to detect when someone is at the full article and get the postid from the article displayed.

    I hope that makes sense.

  4. stvwlf
    Member
    Posted 9 months ago #

    Yes

    What you are looking for are called WordPress conditionals.

    The full article is called the Single Post page, and the conditional is
    if ( is_single() )

    You can also insert a post ID or slug between the is_single inner parentheses. The default is the current post.

    read more here:
    http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page

  5. coolkidsunion
    Member
    Posted 9 months ago #

    This worked perfectly thank you very much!

Reply

You must log in to post.

About this Topic