• Hello,
    All of my post grids have been broken after the recent update.
    Instead of showing the regular posts they now show a lot of this:

    Warning: Invalid argument supplied for foreach() in /home/mywebsite/public_html/wp-content/plugins/post-grid/grid-items/variables.php on line 45

    Warning: Invalid argument supplied for foreach() in /home/mywebsite/public_html/wp-content/plugins/post-grid/includes/functions.php on line 105

    Warning: Invalid argument supplied for foreach() in /home/mywebsite/public_html/wp-content/plugins/post-grid/grid-items/layer-content.php on line 27

    Please help as this is on a live site.
    I thought perhaps the issue was that after the upgrade the post type had been changed to post – so I changed it back to the custom post type each of them had, and that now shows the posts, but still all these foreach errors show up along with the fact that my css is not working anymore.

    https://www.ads-software.com/plugins/post-grid/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can you please edit post grid and check all settings and save settings,

    please let me know if the error still happening.

    Regards

    Thread Starter kwaifeh

    (@kwaifeh)

    I tried but that did not help. I eventually had to revert to the older version and prevent updates. That solved the problem for me. Thank you for your suggestions and for the plugin of course ??

    Can you please create new Post Grid and try again,
    Also please provide me screenshot of your broken part.

    If you need some more help please go our official website and contact page try to reach we could help more.

    Regards

    Update broke my post grid also.

    My only error is:
    Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/wp-content/plugins/post-grid/includes/functions.php on line 105

    It seems to affect only custom post types. I can display posts without an issue.

    I had the same error on line 105 of functions for the plugin.

    It appears that the variable term_list is supposed to be an array, but the array is not set for my custom post types.

    I have temporarily replaced the foreach code chunk starting at line 105 to get this working until there is an update from the plugin author…

    At line 105, replace this:

    foreach($term_list as $term_key=>$term)
    		{
    			foreach($term as $term_id=>$term){
    				$term_slug_list .= $term->slug.' ';
    				}
    		}

    with this:

    if (is_array($term_list)):
    	foreach($term_list as $term_key=>$term)
    		{
    			foreach($term as $term_id=>$term){
    				$term_slug_list .= $term->slug.' ';
    				}
    		}
    endif;

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Post grids all broken after update’ is closed to new replies.