Get woocommerce catogry

It’s not working because you didn’t pass the Woocoomerce’s Product category taxonomy. By default get_categories() function will returns all terms data of default category taxonomy, if you did’t mention specific taxonomy slug inside the arguments list. So, To retrieve the terms data of any specific taxonomy, We must have to pass the slug of that … Read more

How to find the number of Tags a post has?

for tags you can use $tags = get_tags(); $categories = get_categories(); $no_of_tags = count($tags); $no_of_categories = count($categories); refer this if you need more details : http://codex.wordpress.org/Function_Reference/get_tags http://codex.wordpress.org/Function_Reference/get_categories

How to create A-Z index listing for custom post types?

Ok, you just have to make a loop with first letter check. WordPress query will handle the post_title ASC order. EDIT : I use get_permalink() within the loop to get URL (https://developer.wordpress.org/reference/functions/get_permalink/) $series = new WP_Query(array( ‘posts_per_page’ => -1, ‘post_type’ => ‘series_type’, ‘orderby’ => ‘title’, ‘order’ => ‘asc’ )); if($series->have_posts()) { $letter=””; while($series->have_posts()) { $series->the_post(); … Read more

Similar posts formatting

I’ve responded to your thread on the WP forums, see here.. http://wordpress.org/support/topic/simple-question-about-similar-posts-plugin You can do what you want from the plugin’s settings page.. EDIT: Following the CSS suggestion, if you wanted to try this method. Leave the fields as they were Update the <ul> field to now read <ul id=”my_special_id”> Update your theme’s style.css file … Read more

List the number of posts for each custom taxonomy and specific custom field value

The solution is: global $wpdb; $terms = get_terms(“TAXONOMY_TERM”); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $querystr = ” SELECT count(ID) as count FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE exists ( SELECT * FROM $wpdb->postmeta WHERE … Read more

Editing a Post, 99% CPU?

You may be dealing with the dreaded mod_security when your posting or updating . see if it’s enabled on the server first, if your using antimalware software it may be trying to scan on save . ok that’s the easy try . the next is to turn off your plugins . wsiwig editors., seo plugins … Read more

Filter Posts by Excluding Categories

You can hook into the load-edit.php action to modify how wp-admin lists pages. Add this to your functions.php: <?php add_action( ‘load-edit.php’, ‘namespace_modify_admin_list’ ); function namespace_modify_admin_list() { global $typenow; if ( ‘post’ !== $typenow ) return; add_action( ‘pre_get_posts’, ‘namespace_modify_admin_list_posts’ ); } function namespace_modify_admin_list_posts( $query ) { /** * Modify query here to change how posts are … Read more

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