Problem after changing PHP versio 5.6 to 7.4
-
Hi i got this code:
<? // set arguments for get_posts() $args = array[ 'numberposts' => '1', 'orderby' => 'rand', 'category' => '139', 'exclude' => '5336,5334,5331,5329,5327,5325,5323,5321,5317,5313,5310,5272' ]; // get a random post from the database $my_random_post = get_posts ( $args ); // process the database request through a foreach loop foreach ( $my_random_post as $post ) { // redirect the user to the random post wp_redirect ( get_permalink ( $post->ID ), 307 ); exit; } ?>
Its working fine on php ver.5.6 but when I change php to 7.4 it`s not working anymore… All i get is error like this:
'1', 'orderby' => 'rand', 'category' => '139', 'exclude' => '5336,5334,5331,5329,5327,5325,5323,5321,5317,5313,5310,5272' ]; // get a random post from the database $my_random_post = get_posts ( $args ); // process the database request through a foreach loop foreach ( $my_random_post as $post ) { // redirect the user to the random post wp_redirect ( get_permalink ( $post->ID ), 307 ); exit; } ?>
What to change in this code to make it run on php 7.4 ? Im sorry but Im not a programmer. Thanks for any help
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Problem after changing PHP versio 5.6 to 7.4’ is closed to new replies.