Whoops \ Exception \ ErrorException (E_WARNING)
Invalid argument supplied for foreach() Whoops\Exception\ErrorException thrown with message "Invalid argument supplied for foreach()" Stacktrace: #8 Whoops\Exception\ErrorException in /var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php:9 #7 Whoops\Run:handleError in /var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php:9 #6 require in /var/www/wp-includes/template.php:732 #5 load_template in /var/www/wp-includes/template.php:676 #4 locate_template in /var/www/wp-includes/general-template.php:204 #3 get_template_part in /var/www/wp-content/themes/musicplay/musicband/artists/single-artists.php:203 #2 include in /var/www/wp-includes/template-loader.php:106 #1 require_once in /var/www/wp-blog-header.php:19 #0 require in /var/www/index.php:17
Stack frames (9)
8
Whoops
\
Exception
\
ErrorException
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
artist-related.php
9
7
Whoops
\
Run
handleError
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
artist-related.php
9
6
require
/
var
/
www
/
wp-includes
/
template.php
732
5
load_template
/
var
/
www
/
wp-includes
/
template.php
676
4
locate_template
/
var
/
www
/
wp-includes
/
general-template.php
204
3
get_template_part
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
single-artists.php
203
2
include
/
var
/
www
/
wp-includes
/
template-loader.php
106
1
require_once
/
var
/
www
/
wp-blog-header.php
19
0
require
/
var
/
www
/
index.php
17
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
artist-related.php
<?php

global $post, $relatedpostid, $atp_more_artist_from_txt;

$terms = get_the_terms( $relatedpostid, 'artist_cat' ); // get an array of all the terms as objects.

$termcat = array();

foreach ( $terms as $term ) {
    $termcat[] = $term->slug; // save the slugs in an array
}

$column_index = 0;

$default_columns = get_option( 'atp_artist_related_limit' )
                ? get_option( 'atp_artist_related_limit' )
                : '6';

$allowed_tags = wp_kses_allowed_html( 'post' );
$columns      = $default_columns;

$class  = '';
$width  = '';
$height = '';

if ( '2' === $columns ) {
    $class = 'col-2';
}
if ( '3' === $columns ) {
    $class = 'col-3';
}
if ( '4' === $columns ) {
    $class = 'col-4';
}
if ( '5' === $columns ) {
    $class = 'col-5';
}
if ( '6' === $columns ) {
    $class = 'col-6';
}
Arguments
  1. "Invalid argument supplied for foreach()"
    
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
artist-related.php
<?php

global $post, $relatedpostid, $atp_more_artist_from_txt;

$terms = get_the_terms( $relatedpostid, 'artist_cat' ); // get an array of all the terms as objects.

$termcat = array();

foreach ( $terms as $term ) {
    $termcat[] = $term->slug; // save the slugs in an array
}

$column_index = 0;

$default_columns = get_option( 'atp_artist_related_limit' )
                ? get_option( 'atp_artist_related_limit' )
                : '6';

$allowed_tags = wp_kses_allowed_html( 'post' );
$columns      = $default_columns;

$class  = '';
$width  = '';
$height = '';

if ( '2' === $columns ) {
    $class = 'col-2';
}
if ( '3' === $columns ) {
    $class = 'col-3';
}
if ( '4' === $columns ) {
    $class = 'col-4';
}
if ( '5' === $columns ) {
    $class = 'col-5';
}
if ( '6' === $columns ) {
    $class = 'col-6';
}
Arguments
  1. 2
    
  2. "Invalid argument supplied for foreach()"
    
  3. "/var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php"
    
  4. 9
    
  5. array:83 [
      "_template_file" => "/var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php"
      "require_once" => false
      "args" => []
      "posts" => & array:1 [
        0 => WP_Post {#2}
      ]
      "post" => & WP_Post {#2}
      "wp_did_header" => & true
      "wp_query" => & WP_Query {}
      "wp_rewrite" => & WP_Rewrite {}
      "wpdb" => & wpdb {}
      "wp_version" => & "5.6"
      "wp" => & WP {}
      "id" => & 10431
      "comment" => & null
      "user_ID" => & 0
      "s" => ""
      "page" => 0
      "artists" => "rikjam"
      "post_type" => "artists"
      "name" => "rikjam"
      "error" => ""
      "m" => ""
      "p" => 0
      "post_parent" => ""
      "subpost" => ""
      "subpost_id" => ""
      "attachment" => ""
      "attachment_id" => 0
      "pagename" => ""
      "page_id" => 0
      "second" => ""
      "minute" => ""
      "hour" => ""
      "day" => 0
      "monthnum" => 0
      "year" => 0
      "w" => 0
      "category_name" => ""
      "tag" => ""
      "cat" => ""
      "tag_id" => ""
      "author" => ""
      "author_name" => ""
      "feed" => ""
      "tb" => ""
      "paged" => 0
      "meta_key" => ""
      "meta_value" => ""
      "preview" => ""
      "sentence" => ""
      "title" => ""
      "fields" => ""
      "menu_order" => ""
      "embed" => ""
      "category__in" => []
      "category__not_in" => []
      "category__and" => []
      "post__in" => []
      "post__not_in" => []
      "post_name__in" => []
      "tag__in" => []
      "tag__not_in" => []
      "tag__and" => []
      "tag_slug__in" => []
      "tag_slug__and" => []
      "post_parent__in" => []
      "post_parent__not_in" => []
      "author__in" => []
      "author__not_in" => []
      "ignore_sticky_posts" => false
      "suppress_filters" => false
      "cache_results" => false
      "update_post_term_cache" => true
      "lazy_load_term_meta" => true
      "update_post_meta_cache" => true
      "posts_per_page" => 10
      "nopaging" => false
      "comments_per_page" => "50"
      "no_found_rows" => false
      "order" => "DESC"
      "relatedpostid" => & 10431
      "atp_more_artist_from_txt" => & "More Artist From:"
      "terms" => false
      "termcat" => []
    ]
    
/
var
/
www
/
wp-includes
/
template.php
        /*
         * This use of extract() cannot be removed. There are many possible ways that
         * templates could depend on variables that it creates existing, and no way to
         * detect and deprecate it.
         *
         * Passing the EXTR_SKIP flag is the safest option, ensuring globals and
         * function variables cannot be overwritten.
         */
        // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
        extract( $wp_query->query_vars, EXTR_SKIP );
    }
 
    if ( isset( $s ) ) {
        $s = esc_attr( $s );
    }
 
    if ( $require_once ) {
        require_once $_template_file;
    } else {
        require $_template_file;
    }
}
 
Arguments
  1. "/var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php"
    
/
var
/
www
/
wp-includes
/
template.php
function locate_template( $template_names, $load = false, $require_once = true, $args = array() ) {
    $located = '';
    foreach ( (array) $template_names as $template_name ) {
        if ( ! $template_name ) {
            continue;
        }
        if ( file_exists( STYLESHEETPATH . '/' . $template_name ) ) {
            $located = STYLESHEETPATH . '/' . $template_name;
            break;
        } elseif ( file_exists( TEMPLATEPATH . '/' . $template_name ) ) {
            $located = TEMPLATEPATH . '/' . $template_name;
            break;
        } elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
            $located = ABSPATH . WPINC . '/theme-compat/' . $template_name;
            break;
        }
    }
 
    if ( $load && '' !== $located ) {
        load_template( $located, $require_once, $args );
    }
 
    return $located;
}
 
/**
 * Require the template file with WordPress environment.
 *
 * The globals are set up for the template file to ensure that the WordPress
 * environment is available from within the function. The query variables are
 * also available.
 *
 * @since 1.5.0
 * @since 5.5.0 The `$args` parameter was added.
 *
 * @global array      $posts
 * @global WP_Post    $post          Global post object.
 * @global bool       $wp_did_header
 * @global WP_Query   $wp_query      WordPress Query object.
 * @global WP_Rewrite $wp_rewrite    WordPress rewrite component.
Arguments
  1. "/var/www/wp-content/themes/musicplay/musicband/artists/artist-related.php"
    
  2. false
    
  3. []
    
/
var
/
www
/
wp-includes
/
general-template.php
    if ( '' !== $name ) {
        $templates[] = "{$slug}-{$name}.php";
    }
 
    $templates[] = "{$slug}.php";
 
    /**
     * Fires before a template part is loaded.
     *
     * @since 5.2.0
     * @since 5.5.0 The `$args` parameter was added.
     *
     * @param string   $slug      The slug name for the generic template.
     * @param string   $name      The name of the specialized template.
     * @param string[] $templates Array of template files to search for, in order.
     * @param array    $args      Additional arguments passed to the template.
     */
    do_action( 'get_template_part', $slug, $name, $templates, $args );
 
    if ( ! locate_template( $templates, true, false, $args ) ) {
        return false;
    }
}
 
/**
 * Display search form.
 *
 * Will first attempt to locate the searchform.php file in either the child or
 * the parent, then load it. If it doesn't exist, then the default search form
 * will be displayed. The default search form is HTML, which will be displayed.
 * There is a filter applied to the search form HTML in order to edit or replace
 * it. The filter is {@see 'get_search_form'}.
 *
 * This function is primarily used by themes which want to hardcode the search
 * form into the sidebar and also by the search widget in WordPress.
 *
 * There is also an action that is called whenever the function is run called,
 * {@see 'pre_get_search_form'}. This can be useful for outputting JavaScript that the
 * search relies on or various formatting that applies to the beginning of the
 * search. To give a few examples of what it can be used for.
Arguments
  1. array:2 [
      0 => "musicband/artists/artist-related.php"
      1 => "musicband/artists/artist.php"
    ]
    
  2. true
    
  3. false
    
  4. []
    
/
var
/
www
/
wp-content
/
themes
/
musicplay
/
musicband
/
artists
/
single-artists.php
            <?php
            $comments = get_option( 'atp_artist_comments' );

            if ( 'enable' === $comments ) {
                comments_template( '', true );
            }
            ?>
            </div><!-- .content-area -->

            <?php
            if ( 'fullwidth' !== atp_generator( 'sidebaroption', $post->ID ) ) {
                get_sidebar();
            }
            ?>
        </div><!-- inner -->
    </div><!-- #primary.pagemid -->
    <?php
    $artistcat = get_multi_tax_list( $relatedpostid, 'artist_cat', true, '', ', ', '' );
    if ( '' !== $artistcat && 'on' !== $atp_artist_related ) {
        get_template_part( 'musicband/artists/artist', 'related' );
    }

    if ( 'on' !== $atp_artist_albums ) {
        get_template_part( 'musicband/artists/artists', 'albums' );
    }
    ?>
<?php
get_footer();
 
Arguments
  1. "musicband/artists/artist"
    
  2. "related"
    
/
var
/
www
/
wp-includes
/
template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
Arguments
  1. "/var/www/wp-content/themes/musicplay/musicband/artists/single-artists.php"
    
/
var
/
www
/
wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
Arguments
  1. "/var/www/wp-includes/template-loader.php"
    
/
var
/
www
/
index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 
Arguments
  1. "/var/www/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache"
REQUEST_URI
"/artist/rikjam/"
PATH
"/sbin:/usr/sbin:/bin:/usr/bin"
PHP_FCGI_MAX_REQUESTS
"0"
GD_PHP_HANDLER
""
HOME
"/var/www"
HTTP_CONNECTION
"close"
SCRIPT_NAME
"/index.php"
QUERY_STRING
""
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_URL
"/artist/rikjam/"
REMOTE_PORT
"38606"
SCRIPT_FILENAME
"/var/www/index.php"
SERVER_ADMIN
"support@secureserver.net"
CONTEXT_DOCUMENT_ROOT
"/var/www"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"http"
DOCUMENT_ROOT
"/var/www"
REMOTE_ADDR
"3.239.109.55"
SERVER_PORT
"80"
SERVER_ADDR
"107.180.122.22"
SERVER_NAME
"irieyuterecords.com"
SERVER_SIGNATURE
""
LD_LIBRARY_PATH
"/web/httpd24/lib"
HTTP_X_HOST
"irieyuterecords.com"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_X_VARNISH
"586293631"
HTTP_X_FORCED
"1"
HTTP_X_COOKIES
""
HTTP_HOST
"irieyuterecords.com"
HTTP_X_FORWARDED_FOR
"3.239.109.55"
HTTP_X_CLIENT_IP
"3.239.109.55"
HTTP_X_UA_DEVICE
"bot"
HTTP_X_EPOCH_TIME
"1611408302"
HTTP_X_REQUEST_ID
"03EF6D378376C647E96A0050600C23AE573C82581AAE5"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_AUTHORIZATION
""
XID
"42142845"
UNIQUE_ID
"YAwjrso4RLPd-LagJ2p-rwAABVQ"
REDIRECT_STATUS
"200"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_XID
"42142845"
REDIRECT_UNIQUE_ID
"YAwjrso4RLPd-LagJ2p-rwAABVQ"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1611408302.534
REQUEST_TIME
1611408302
empty
0. Whoops\Handler\PrettyPageHandler