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

Any way to show different version of WP blog post based on referrer?

Discussion in 'Cloaking and Content Generators' started by paper_chase, May 7, 2009.

  1. paper_chase

    paper_chase Regular Member

    Joined:
    Oct 17, 2008
    Messages:
    394
    Likes Received:
    42
    Hey guys,

    I've ran into a small problem. I need to show a different version of a wordpress blog post based on the referrer. Different version of the same blog post is required since I need the URL to appear the same. Is this possible? Do I need a 3rd party wordpress plugin?

    Any suggestions are greatly appreciated. Thanks.
     
  2. paper_chase

    paper_chase Regular Member

    Joined:
    Oct 17, 2008
    Messages:
    394
    Likes Received:
    42
    Looks like I created a duplicate thread somehow. Please post any advice in this one. Thanks!!
     
  3. kautilya

    kautilya Registered Member

    Joined:
    Feb 17, 2009
    Messages:
    69
    Likes Received:
    9
    Yes,

    1. First remove the version meta line that is automatically generated by putting this line in the functions.php file of our theme,

    Code:
    add_filter( 'the_generator', create_function('$a', "return null;") );
    2. Then detect referrer by using,

    Code:
    ref=$_SERVER['HTTP_REFERER'];

    3. Then insert version by putting code like following in header.php file of your theme just before </header>,

    Easy?
     
  4. paper_chase

    paper_chase Regular Member

    Joined:
    Oct 17, 2008
    Messages:
    394
    Likes Received:
    42
    Thanks for the quick response. But my different version of the blog post I mean that actual written content of the blog post is different.

    Example:

    Post A contains the text: "use the following (not allowed by affiliate manager) coupon to save 10 percent on your order"

    while

    Post B contains the text: "use the following (approved by affiliate manager) coupon to save 5 percent on certain brands"

    I need both posts to be at the same URL as the referrer will be the same.

    Anyway to do this?? Thankss!!!!
     
  5. kautilya

    kautilya Registered Member

    Joined:
    Feb 17, 2009
    Messages:
    69
    Likes Received:
    9
    ohhh, I misunderstood the question.

    In your case, use the_content hook to insert different content based on different referrer. You can find out referrer using the same php variable describe above.
     
  6. fatjack'sblackhat

    fatjack'sblackhat Jr. VIP Jr. VIP Premium Member

    Joined:
    Jul 16, 2008
    Messages:
    611
    Likes Received:
    129
    Occupation:
    college student
    Location:
    Florida
    That sounds like a good way to do it but I might try to be a little more dramatic like. SAVE 50 % and then display the allowed one