• Resolved kaloyan.kostov

    (@kaloyankostov)


    Hello! Before my page tittle i have some paragraph –> Warning: Invalid argument supplied for foreach() in \raindrops\functions.php on line 8984.
    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author nobita

    (@nobita)

    This is Bug of Raindrops

    This error occurs if you do not use all the sidebar widget.

    Quick Fix

    Add functions.php at top below code.

    function raindrops_get_pinup_widget_ids() {
    
    		$widgets = wp_get_sidebars_widgets();
    		$ids	 = array();
    
    		if ( isset( $widgets ) && is_array( $widgets )){
    
    			foreach ( $widgets as $key => $val_array ) {
    
    				if ( preg_match( '$sidebar$', $key ) ) {
    
    					foreach ( $val_array as $widget ) {
    
    						if ( preg_match( '$raindrops_pinup_entry_widget-([0-9]+)$', $widget, $regs ) ) {
    
    							$ids[] = absint( $regs[ 1 ] );
    						}
    					}
    				}
    			}
    		}
    		return $ids;
    	}

    After the change, please set to be as follows

    <?php
    	function raindrops_get_pinup_widget_ids() {
    
    		$widgets = wp_get_sidebars_widgets();
    		$ids	 = array();
    
    		if ( isset( $widgets ) && is_array( $widgets )){
    
    			foreach ( $widgets as $key => $val_array ) {
    
    				if ( preg_match( '$sidebar$', $key ) ) {
    
    					foreach ( $val_array as $widget ) {
    
    						if ( preg_match( '$raindrops_pinup_entry_widget-([0-9]+)$', $widget, $regs ) ) {
    
    							$ids[] = absint( $regs[ 1 ] );
    						}
    					}
    				}
    			}
    		}
    		return $ids;
    	}
    /**
     * functions and constants for Raindrops theme
     *
     *
     * @package Raindrops
     * @since Raindrops 0.1
     */
    if ( !defined( 'ABSPATH' ) ) {
    
    	exit;
    }
    /**
     * include raindrops custom settings

    This bug will be fix next update.

    Thank you.

    Thread Starter kaloyan.kostov

    (@kaloyankostov)

    Thank you so much.

    Hello,

    I’m afraid I do not understand where to insert these two sets of code.

    Can you tell me which lines the codes should be inserted at?

    Thank you.

    Theme Author nobita

    (@nobita)

    Hi jamespeterson941

    To resolved questions, additional post please do not from next time.

    This error does not always occur at any time.

    Your site, if you have not an error, you do not need to change.

    New version that fixes this bug can be provided anymore for a while.

    If you are in a hurry if, please download the latest version from the following

    https://github.com/tenman/raindrops/releases

    Thank you 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problem on line 8984 in function.php’ is closed to new replies.