Wordpress URL parameters

Discussion in 'PHP' started by mads, Jan 11, 2008.

  1. #1
    Hi,

    How do you make WordPress (PHP CMS) accept parameters in the URL?

    I want to be able to write something like:
    http://www.blog.com/my-post?parameter1=a&parameter2=b

    So far I haven't been able to make it work, so does anybody around here know how to do?

    (it would be great if I use one of my blog pages as landing page for my AdWords campaign)

    Thanks,
    Mads
     
    mads, Jan 11, 2008 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    it has been like 1 year or more i dident play with this, i check my code to see what i used to use paging using wordpress url parametere and this is the code :

    $page_nb = $_SERVER['REQUEST_URI']; // not sure what it will be if there is more than 1 variable

    and i forget to mention , i had to set this as a template code .

    this was tested on wp 2.0
     
    commandos, Jan 11, 2008 IP
  3. mads

    mads Well-Known Member

    Messages:
    762
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #3
    What kind of permalinks do you use and where do you place the code in the template?

    I prefer to have only postnames and then WP can't find out how to handle parameters - i.e. it can't find the right post.
     
    mads, Jan 12, 2008 IP
  4. gjsmith66

    gjsmith66 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This plugin may help you. I recently had a situation in which I needed to pass a URL parameter into WordPress so that it could be inserted into all links off of a blog page. For example, a partner would pass traffic to a blog using the format ?refcode=joe. All links embedded in the post would need to pass the value of refcode if it existed, even if the visitor requested multiple pages after the initial visit.

    cookie-monster-wordpress-url-parameter-utility
     
    gjsmith66, Dec 9, 2009 IP