Get url parameter with $ _GET coming from an iframe - WORDPRESS

2

I have a difficulty, inside my site I put a iframe that has a button that directs to another page within my site via GET .

But this button is already preset.

ex.:

The link you have inside the iframe goes to link

I think I have to create a page with the same name Details and inside it put the function $_GET['id'] ;

I even used a plugin that reads php, and nothing ..

I've placed an iframe inside my website from another server follow the site link and when I click on more details the link goes to another page with the id in the URL only in wordpress does not allow me to use GET

Does anyone have an idea what should be done?

    
asked by anonymous 29.01.2015 / 13:33

1 answer

1

You should "cheat" wordpress, since when you pass parameters by url you get the error 404 Not Found . Create this simple plugin in your functions.php:

<?php

add_filter('query_vars', 'parameter_queryvars' );
function parameter_queryvars( $qvars )
{
$qvars[] = 'id';
return $qvars;
}
?>

HERE IS THE CONDITIONAL TO OBTAIN THE ID VALUE

global $wp_query;
if (isset($wp_query->query_vars['id'])){
print $wp_query->query_vars['id'];

//código aqui, da página
}
    
29.01.2015 / 14:14