Trying to get property of non-object in WordPress Breadcrumbs

You need to check if get_the_terms() is actually returning anything. If a post doesn’t have terms in that taxonomy, then $taxonomy_terms won’t actually have any terms in it. If $taxonomy_terms is empty then $taxonomy_terms[0] won’t actually be a term object so trying to access a property on it (->term_id) will throw an error: $taxonomy_exists = … Read more

Override Admin menu icon

One way is to use the admin_menu hook to insert CSS with your selection of menu icons (which use the DashIcons). The googles show this recent result: https://swapnil.blog/2018/06/25/how-to-change-wordpress-admin-icons/ . Here’s some code from there; you’ll just need to figure out the CSS for each menu item – use your Developer inspection tools (F12, usually) to … Read more

Show all tags within a category?

The best way to do that would be to create a custom page template, and make a custom loop that would only display the posts in you specific category and tag. For example: global $wp_query; $args = array( ‘category__and’ => ‘category’, ‘tag__in’ => ‘post_tag’, //Enter tag id for this field (not tah name) ‘posts_per_page’ => … Read more

Undefined offset: 0-wp-includes/meta.php:488 -Melding

You should change $parents[] to $parents in get_parents() function: $parents = get_metadata(‘post’, $post_id, WPKWP::$META_CHILD, false); if ($parents !== FALSE && count($parents) > 0) return $parents; return false; because get_metadata return array in this case. If the $post_id parameter is invalid, false is returned. If the meta value isn’t set, function return an empty array. Therefore, … Read more