Object of class WP_Query could not be converted to int inside shortcode

I rewrote the function based on a few other posts I have seen online and now have the following code which works without any errors. I am still open to any further suggestions on the best way to streamline this code even further it it can be. Thanks again function downloads_shortcode($atts){ extract(shortcode_atts(array( ‘download_type’ => ” … Read more

Title tag wont change

see there are any upgrade available for the theme.. if not add add_theme_support( ‘title-tag’ ); in your functions.php

How do I create a state of “don’t assign anything to variable” if WP_Error throws an error?

Looks like the line giving you the error is rather this one $data = json_decode( $this->get_json(), true); Like this (untested) it should work: private function get_data() { /** * Ingests the data from get_json() then converts / decodes into an array. */ $json = $this->get_json(); if (is_wp_error($json)) { return new WP_Error( ‘invalid-data’, esc_html__( ‘Something is … Read more

WP_Error could not be converted to string

There are few problems with your code. First of all, let’s see at wpmu_create_blog function: wpmu_create_blog( string $domain, string $path, string $title, int $user_id, array $meta = array(), int $network_id = 1 ) So you use it incorrectly. It’s 5th argument is $meta and you put $network_id in there… Another problem is that this function … Read more