Error
Call to a member function getMeta() on null Error thrown with message "Call to a member function getMeta() on null" Stacktrace: #3 Error in /home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-content/themes/g5-hydrogen-child/page-artist-collection.php:19 #2 include in /home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-includes/template-loader.php:106 #1 require_once in /home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-blog-header.php:19 #0 require in /home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/index.php:17
Stack frames (4)
3
Error
/home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-content/themes/g5-hydrogen-child/page-artist-collection.php19
2
include
/home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-includes/template-loader.php106
1
require_once
/home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/wp-blog-header.php19
0
require
/home/arnoldgal/domains/kunstgalerie-arnold.nl/public_html/index.php17
<?php
/*
Template Name: Artist Collection
Template Post Type: post, page, event
*/
    
    /**
        * Template to show image collection by taxonomies like Artist, Categor OR Object
        
        * IMPORTANT NOTE:  This templates shows English Version 
        
    */
    global $wp_query; 
 
    $lng = get_locale();
    
    get_header();
 
    $artist_id = $wp_query->virtual_page->getMeta('id'); // get the end element of uri. i.e artist id
 
    if(is_numeric($artist_id) == false) {
        wp_redirect( home_url() );
    }
    
    $gallery_imgs = get_posts(array(
    'post_type'         => 'attachment',
    'posts_per_page'    => -1,
    'post_mime_type'    => 'image',
    'post_status'       => 'inherit',
    'meta_query' => array(
    'relation' => 'OR',
    array( 
    'key'=>'serial_no',
    'compare' => 'EXISTS'           
    ),
    array( 
    'key'=>'serial_no',
    'compare' => 'NOT EXISTS'           
    )
    ),
            }
 
            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;
}
 
<?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';
 
}
 
<?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';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache/2
REQUEST_URI /artist-collection/
USER arnoldgal
HOME /home/arnoldgal
SCRIPT_NAME /index.php
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /artist-collection/
REMOTE_PORT 48230
SCRIPT_FILENAME /home/arnoldgal/domains/kunstgalerie-arnold.nl/private_html/index.php
SERVER_ADMIN webmaster@kunstgalerie-arnold.nl
CONTEXT_DOCUMENT_ROOT /home/arnoldgal/domains/kunstgalerie-arnold.nl/private_html
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /home/arnoldgal/domains/kunstgalerie-arnold.nl/private_html
REMOTE_ADDR 216.73.216.103
SERVER_PORT 443
SERVER_ADDR 46.4.121.176
SERVER_NAME www.kunstgalerie-arnold.nl
SERVER_SIGNATURE
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_REFERER https://www.kunstgalerie-arnold.nl/?p=149
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_X_FORWARDED_FOR 216.73.216.103
HTTP_HOST www.kunstgalerie-arnold.nl
HTTP_X_ACCEL_INTERNAL /nginx_static_files
proxy-nokeepalive 1
SSL_TLS_SNI www.kunstgalerie-arnold.nl
HTTPS on
HTTP_AUTHORIZATION
UNIQUE_ID aTVBQ868Xv9m4Od1X-rf5wAAADg
REDIRECT_STATUS 200
REDIRECT_SSL_TLS_SNI www.kunstgalerie-arnold.nl
REDIRECT_HTTPS on
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_UNIQUE_ID aTVBQ868Xv9m4Od1X-rf5wAAADg
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1765097795.292
REQUEST_TIME 1765097795
empty
0. Whoops\Handler\PrettyPageHandler