Hi I was wondering if anyone could help me.
I would like all links on my blog to have a custom value appended to its URL. So in php I can use $_REQUEST['x'] to see what this value is.
Eg,
http://site.com/wordpress/?p=1&x=value#comments
and
http://site.com/wordpress/diablo/?page_id=3&x=value
So I need someway to modify all the URLS wordpress generates to have "&x=value" in the appropriate place.
Any suggestions are welcome. Thanks
will the key / value always be the same?
Maybe I don't understand. If all pages are going to have the same key / value, why do you need to use $_REQUEST to know what it is?
When you say all links, do you mean href links or pages?
Let me explain what I am trying to do.
I have a main php script which wraps around wordpress (mysite_index.php).
In mysite_index.php the code is like.
if($_REQUEST['page'] == 'blog'){
require('./wordpress/wp-blog-header.php');
}else if($_REQUEST['page'] == 'register'){
require('./register.php');
}//etc....
Now in the included wordpress code through require('./wordpress/wp-blog-header.php'); I want wordpress to generate its links like.
http://site.com/?p=1&page=blog#comments
and
http://site.com/?page_id=3&page=blog
So the wrapping mysite_index.php script knows to include wordpress which is located under http://site.com/.
Sorry, Its difficult to explain
Hmmm. Try putting this in your functions.php file:
add_action('init','thisismyblog');
function thisismyblog(){
$_GET['page']='blog';
}
Let me know if that works.
Good thinking and nice try.
Unfortunatlly no luck.
Printing out $_GET in thisismyblog() gives..
Array ( [m] => 200810 [page] => blog )
I think my problem is difficult because WordPress dosnt generate its links through one common function. Then again im no expert on wordpress...
Why don't you just put WordPress in a subfolder called blog?