Double page load
-
I saw that after activating AIOS plugin when opening page, script is triggered twice. To test it, I made a simple shortcode.
function my_test_shortcode_fun() { $post_id = get_the_ID(); $loads = get_post_meta( $post_id, 'load_1', true ); if($loads==1){ $load_txt='Is Load 2'; update_post_meta($post_id , 'load_2', 2); }else{ $load_txt='Is Load 1'; update_post_meta($post_id , 'load_1', 1); } return $load_txt; } add_shortcode('my_test_shortcode', 'my_test_shortcode_fun');
After opening the page once, two custom fields will be created. From this you can see that shortcode is triggered twice. If you deactivate AIOS plugin, then when the page is opened once, only one field is created, as it should be. How do I fix this double triggering?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Double page load’ is closed to new replies.