Polylang 1.5.3 => Warning frontend-auto-translate.php l.160
-
Hi, I’m having kind of a conflict with Polylang when setting Flexslider on the homepage along with a very short custom script. I don’t get how the latter can affect Polylang and even WordPress database…
I was getting this message:
Warning: Invalid argument supplied for foreach() in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\projects\mywebsite.com\wp-content\plugins\polylang\frontend\frontend-auto-translate.php on line 160I then disabled Polylang and got:
Warning: array_map(): Argument #2 should be an array in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\projects\mywebsite.com\wp-includes\query.php on line 2448
Warning: implode(): Invalid arguments passed in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\projects\mywebsite.com\wp-includes\query.php on line 2448
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘ at line 1]
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.ID IN () AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10All these error messages have appeared while I was trying to integrate Flexslider on the home page (home.php) with this short script :
`<?php /* Slider Query*/
//create a table containing the IDs of all the posts we want to display within the slider
$count = of_get_option(‘home_slides_number’)+1;
$slider_all_posts = array(); //set var
for ($i = 1; $i <= $count; $i++) {
$slider_all_posts = of_get_option(‘select_slide_’.$i); //return posts IDs
}//query posts through the IDs
$slider = new WP_Query( array( ‘post_type’ => ‘post’,
‘post__in’ => $slider_all_posts));//loop
if ($slider->have_posts()) : while ($slider->have_posts()) : $slider->the_post();
$slide_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘home_slider_img_size’);
?>
`I suspect $slider_all_posts array is bringing the trouble, since when I had not set the option framework page, there was no problem => it was displaying all posts in the slider without any warning message on the page).
Website background
==================
-No static front page
-Permalinks set on article’s name
- The topic ‘Polylang 1.5.3 => Warning frontend-auto-translate.php l.160’ is closed to new replies.