To get number of woocommerce published products –
$total_products = count( get_posts( array('post_type' => 'product', 'post_status' => 'publish', 'fields' => 'ids', 'posts_per_page' => '-1') ) );
To get attributes count –
$total_attribute_terms = get_terms('pa_'. $attribute_slug, array('hide_empty' => false, 'fields' => 'count') );
The $attribute_slug can be found on Attribute edit page – Wp admin -> Products -> Attributes -> click on fly-out menu edit (not name)
Related Posts:
- Disable update notification for individual plugins
- Best Practice for Referencing the Plugin Directory
- Selling WordPress sites?
- Is there a maintenance mode in WordPress core?
- How to make WordPress use protocol indepentent upload files?
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- WP Plugin for Terms of Use
- Adding Scripts in the Admin Area
- Is there a good plugin for social bookmarking on site for WordPress [closed]
- Automagic Link Shortening for Non-Hosted WP
- Popup Maker nav menu item not working
- how can i limit the number of instances for my widget
- What are the hierarchy of filenames while initialising a WordPress plugin?
- Creating a menu page in a Object Oriented developed plugin
- How to trigger an action with a URL
- Are there any plugins yet that support Facebook Like, Google +1 and allow Social Interaction tracking on Google Analytics
- wordpress theme backend admin only
- Im unable to login to my wordpress
- Change the backend language of a single plugin
- Search is not working on plugin directory
- Is it possible to create Custom Post plug-in?
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- why doesn’t this update part of this plugin work? it take me to nothing here page
- getting an installation failed error when trying to load a plugin from a free theme
- woocommerce product countdown not showing in variable product? [closed]
- Session destroyed on page redirect
- Fatal error: Call to undefined function cmsms_theme_page_layout_scheme()
- Excerpts on category page
- Cannot access my wp-admin after installing Gzip compression [closed]
- WordPress Plugin manipulate have_posts()
- Where are theme codes located for WordPress?
- a weird attribute on every html tag
- Front-end CSS Library for plugin [closed]
- Add bcc to contact from on wordpress
- Turning on output buffering in a wordpress plugin
- Is there a plugin for uploading files such as PDF files?
- Register google jquery gets overwritten by plugin
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Location dependent rendering of locations? [closed]
- Why Does The `auto_update_plugin` Hook Disable Management?
- get_comments_number() giving wrong results! What are alternatives?
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Is there a script to collect all hooks and filters provided by a plugin?
- Set up functions to be overridden without using function_exists() by short-circuiting them?
- WP RSS Aggregator plugins breaks after switch to HTTPS
- Post status doesn’t update to ‘future’ every time?
- Add wordpress user database on android app
- Grab ID from post from plugin and use it to create an object
- Enqueue script: link not working in page source
- Help with a function in a widget
- Is wp_deregister_script the best way to deal with unneeded plugins in a page?
- Error: Can´t access facebook comment plugin admin page
- how to convert XML from URL to HTML
- i want to rewrite my custom plugin url
- Apply a Meta tag to one page only
- Can I remove an image from the Gallery without deleting it from the Media Library?
- Strange Cached File in Super Cache
- Wp-minify doesn’t seem to minify my JS code
- eaccelerator PHP error
- Plugin Hook When New Author Added
- Looking for a good way to include php code in posts, but using special include markup rather than direct php code
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- Best approach to make all tags searchable by the wordpress search function
- WordPress – Ultimate Auction for WooCommerce
- Fail on admin_enqueue_scripts when I try it to upload a CSS file to my WordPress Plugin
- Can we hide a certain user in WP?
- Configure upload folder on WoComerce
- Show Custom Post on Frontend
- WordPress to be used more like an app?
- Hooking into the HTML header container
- Execute function activate/deactivate plugin in specific pages
- Why can I not deregister my style and script on custom post type?
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Using multi-dimensional array with filter
- WordPress Admin sub-level menu issue
- PHP header() not available to use in my plugin
- database – multiple wordpress installations using same database – can they share plugin settings?
- HyperDB failover Delay
- Add class as plugin for other plugins
- Display dashboard other than admin user
- Hidden Some Setting on Post or Page [duplicate]
- Creating themes using the one Plugin (Toolkit)
- WordPress Categories from Plugin
- How do I secure a subdomain using UCC SSL?
- How change menu for each user in plugin?
- Check if user is in a group of another site within multisite network [closed]
- Template from scratch: Sidebars not showing widget
- Facebook meta tags not working properly on WordPress Site
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- Redirect url in plugin to somewhere else?
- is there a plugin that allow editing pages from within pages without entering admin panel?
- Site is setup statically – how to make it content managable?
- WordPress site show white screen after updating some plugins (URGENT) [closed]
- Modifying lightbox plugin to allow for quoting, Does this exist? [closed]
- How to escape html code?
- plugin translations not reflected in admin dashboard
- How to set an exact search box in tablepress plug-in
- Private plugin updating – GitHub zip file changes the plugin directory (with release or branch name)
- add custom filter to plugins page?