PAGE ID – get it and use it issue
-
How can I get and then check this PAGE ID which is a post id due to my permalink setup,
I need to do an IF ELSE statement depending on the page id,I have tfe code as follows but only the 1st if works when i am working on the 2nd page it doesnt go into the 2bd if statement.
Its 2 registration forms.add_action( ‘user_register’, ‘add_new_acount_fields_to_metadata’, 10, 1);
function add_new_acount_fields_to_metadata($user_id){
global $page_id;
$page_id = get_the_ID();
if($page_id = 208191){
update_user_meta($user_id, ‘Count_reg_schoolhopper’, 0);
update_user_meta($user_id, ‘Count_hist_per_schoolhopper’, 0);
update_user_meta($user_id, ‘Count_view_per_area’, 0);
update_user_meta($user_id, ‘Cost_model_user_chose’, 1);
}
Else
if($page_id = 210421){
update_user_meta($user_id, ‘Count_reg_schoolhopper’, 0);
update_user_meta($user_id, ‘Count_hist_per_schoolhopper’, 0);
update_user_meta($user_id, ‘Count_view_per_area’, 0);
update_user_meta($user_id, ‘Cost_model_user_chose’, 2);}
}
The page I need help with: [log in to see the link]
- The topic ‘PAGE ID – get it and use it issue’ is closed to new replies.