Taxonomy.php error appearing in the header of my site [closed]

The problem is going to be with theme or plugin code, not with the Core code. Something is using that function incorrectly. For example, this: taxonomy_exists(array()); … produces a Warning that ought to look familiar: Warning: Illegal offset type in isset or empty in /path/to/wordpress/wp-includes/taxonomy.php on line 231 So, somewhere, something is passing a bad … Read more

Taxonomy vs Post Status

Probably post_status but this answer is probably irrelevant in your case. You have your own application with its own usage pattern of the DB therefor the assumptions used when designing wordpress DB for use by core might not fit you. Maybe you will need to add another index to the posts table, maybe create optimized … Read more

Show only first child in dropdown

get_term_children() is by purpose recursive, it will always get all children and is not configurable. get_terms() is more generic function for terms retrieval. Using parent argument for it will only retrieve one level of children (while child_of will retrieve all). See linked documentation in Codex for details.

Match and Merge Terms in Different Taxonomies

Grab all the post tags and loop over them. If it’s deemed an “author” by a pattern match, check to see if the equivalent author_tax term exists. If not, create it. Now you can build two stacks: one for author_tax terms to append to the post, and another for post_tag‘s to be removed. $post_tags = … Read more

Retrieve list of taxonomies in json

Your problem is that your trying to access taxonomy data before it is registered. This doesn’t work: add_action(‘init’, ‘json_handler’); function json_handler(){ $categories = get_terms( ‘my_cat’, ‘orderby=count&hide_empty=0’ ); if( ! is_wp_error( $categories ) ) { // encode the $categories array as json print_r( json_encode( $categories ) ); } } add_action(‘init’, ‘create_stores_nonhierarchical_taxonomy’); function create_stores_nonhierarchical_taxonomy() { // Labels … Read more

List sub-taxonomies from current taxonomy

This may help you: <?php //first get the current term $current_term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); //then set the args for wp_list_categories $args = array( ‘child_of’ => $current_term->term_id, ‘taxonomy’ => $current_term->taxonomy, ‘hide_empty’ => 0, ‘hierarchical’ => true, ‘depth’ => 1, ‘title_li’ => ” ); wp_list_categories( $args ); ?> Source – … Read more

Echo taxonomy name – second level

You can use that code to retrieve the last taxonomy term in your taxonomy list: in your functions.php file create a custom function: function my_custom_function() { global $post; $terms = get_the_terms( $post->ID, ‘location’ ); if (!empty($terms)) { foreach($terms as $term) { if (!get_term_children($term->term_id, ‘location’)) { echo $term->name; } } } } When, inside your archive.php … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)