1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wordpress - PHP help

Discussion in 'Blogging' started by bannor11, May 1, 2012.

  1. bannor11

    bannor11 Junior Member

    Joined:
    Jan 1, 2012
    Messages:
    155
    Likes Received:
    29
    Hi All,

    I'm not familiar with PHP so I apologize if this is something really easy to do. I wasn't able to google exactly what I'm looking for so I'm hoping someone here can help!

    I'm setting up a website using a /%postname%/ as the permalink structure.

    I want to create lookup logic that can use a unique identifier and return the URL of the post with title.

    e.g. mydomain.com/post-title to be returned from mydomain.com/returnpostusinguniqueidentifier.php?id=uniqueID

    How can I achieve this? I imagine I would have to modify the php responsible for generating the post and be able to embed a uniqueID into it (based on the title), but after that how do I do the lookup in my example? Thanks in advance.
     
  2. dracony2

    dracony2 Regular Member

    Joined:
    Mar 5, 2010
    Messages:
    350
    Likes Received:
    321
    Location:
    Jupiter
    You need to use a custom field for that purpose:
    http://codex.wordpress.org/Custom_Fields

    So you assign each post with a custom fields
    and then search posts by custom field

    I could so that for you for 10$
     
  3. cnick79

    cnick79 Jr. VIP Jr. VIP

    Joined:
    Jun 10, 2010
    Messages:
    653
    Likes Received:
    341
    Location:
    Google's SandBox
    Why not use the post/page id that WP generates for you? These are already unique IDs.
     
  4. bannor11

    bannor11 Junior Member

    Joined:
    Jan 1, 2012
    Messages:
    155
    Likes Received:
    29
    I need my own pre-defined unique IDs. Would there be a huge performance impact for doing this lookup using a custom field?