Home > Questions and Answers > General Questions

Wordpress Pages as Landing Pages. Fetching Query String? (4)


09-16-2011 05:21 AM #1 jasontm (Member)
Wordpress Pages as Landing Pages. Fetching Query String?

I've been playing around with it a bit today. Which I'm not having any luck. What I would like to do is pass the url dynamic text from bing to my landing page and show on the page. For keyword relevancy.

I'm using wordpress and I'm passing the keyword similar to this:

domain.com/pag1?kw={querystring}

I installed several plugins letting you post php to your page editor, but I keep getting errors or nothing shows.

Has anyone had success doing this?

I'm using the twenty ten weaver theme if this helps.

Jason


09-16-2011 07:22 AM #2 movingshadow (Member)

jason,

dunno if i get it right but you might try something like this:

1. install http://wordpress.org/extend/plugins/exec-php/
2. insert something like this in your post/page

[PHP]
<?php
$kw = $_GET["kw"];

if ($kw != "") {
echo "you just found a site about ".$kw;
}
?>
[/PHP]

OR

[PHP]
<?php
$kw = $_GET["kw"];
function display_kw() {
if ($kw != "") {
return $kw;
}
}
?>
[/PHP]

and the this do display the kw anywhere you want:

[PHP]
<?php display_kw(); ?>
[/PHP]


09-16-2011 04:23 PM #3 jasontm (Member)

I've tried these and may other variations and for some strange reason. I can't get it to work. I'm not a coder by no means, but I've thought I done this before a few years a go or something.

Talking to someone in another forum he says he got it to work, but never gave me the exact code he used and said all he did was used echo() or print(), but each time I do this. I get php errors on my site.


09-21-2011 04:05 PM #4 dario (Member)

You should paste here some of those errors so we can help


Home > Questions and Answers > General Questions