JDDunn9, post the code you are testing with. I’ll try to duplicate the issue.
Will
After further testing, it looks like it wasn’t the GET variable, it was the code executed if it was set. It looks like the code breaks if you try to use the increment operator “++”. For example, this code also breaks on me.
$i = 0;
$i++;
Insert PHP uses the eval() function to run the PHP code between [insert_php] tags.
When eval() runs, the code is subject to the environment it is running in, the rest of the WP code used to process the page. Which may be why the $_GET[‘id’] was misbehaving earlier. Don’t know without seeing the code you were using. I think id is used to determine which post to publish.
I don’t know why $i is misbehaving. $ti works fine.
[insert_php]
$ti=0;
$ti++;
echo $ti;
[/insert_php]
Suggest trying a different variable name when the current one behaves different than expected.
Will
Gratuitous content so the system will accept the “resolved” checkbox.
1. When i put my set of codes inbetween [insert_php][/insert_php]:
<p align=”left”>
[insert_php]
$name = get_post_custom_values(‘staff_name’);
$image = get_post_custom_values(‘staff_image’);
$info = get_post_custom_values(‘staff_info’);
$email = get_post_custom_values(‘staff_email’);
$contact = get_post_custom_values(‘staff_contact’);
foreach ( $image as $key => $value ) {
echo $value;
foreach ( $name as $key1 => $value ) {
if($key == $key1){
echo “<span class=’staff_name’>”.$value.” “.”| </span>”;
}
foreach ( $info as $key2 => $value ) {
if($key == $key1 && $key1 == $key2){
echo “<span class=’staff_info’>”.” “.$value.”</span>
“;
}
foreach ( $email as $key3 => $value ) {
if($key == $key1 && $key1 == $key2 && $key2 == $key3){
echo “<span class=’staff_detail’><span style=’font-weight:lighter;’>Email:</span>”.” “.$value.”
“;
}
foreach ( $contact as $key4 => $value ) {
if($key == $key1 && $key1 == $key2 && $key2 == $key3 && $key3 == $key4){
echo “<span style=’font-weight:lighter;’>Direct:</span>”.” “.$value.”</span>
“;
}
}
}
}
}
}
[/insert_php]
</p>
<div class=”clear”></div>
2. My output is coming correctly.But, the problem is along with my output, some codes are also displaying at the end.