• Hello,

    When you click on a permalink in Home Page, where is the post id saved? what function can request this ID? thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • within the loop on the home page, the post ID should be gettable with:
    http://codex.wordpress.org/Function_Reference/get_the_ID

    thank you, follow-up question:

    How do i change it so the post i clicked on opens a different page, not the default /?p=ID, but my own mypage.php?p=ID?

    can you elaborate on your question:

    – do you want to use a different single post template (for all or some single posts)?
    – or link to a different template individually per post?

    I want to use my own template for all single posts.
    When i click on a post in homepage i want it to link to this template.

    I want to use my own template for all single posts.

    assuming the your currently used theme does not have one already, create a single.php template;

    per http://codex.wordpress.org/Template_Hierarchy this single.php would be used to show the single post when you click on the link on the home page.

    I have wordpress installed under /blog directory, can i have single.php outside this directory?

    Thank you very much, i have accomplished what i was looking for, my only problem is that using rewrited permalinks (%year%/%postname%) does not load my css file. When i switch to Default permalinks works fine.

    Looking at the links it tries to load /2013/cssfiles…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Post ID’ is closed to new replies.