How can I show an empty WooCommerce cart? [closed]
global $woocommerce; $count = $woocommerce->cart->cart_contents_count; This should be the variable you’d want to work with. Try var_dump on this to display its value.
global $woocommerce; $count = $woocommerce->cart->cart_contents_count; This should be the variable you’d want to work with. Try var_dump on this to display its value.
When at least one template exists for a post type, the ‘Post Attributes’ meta box will be displayed in the back end, without the need to add post type support for ‘page-attributes’. The title ‘Post Attributes’ can be customized per post type using the ‘attributes’ label when registering a post type. Templates for custom post … Read more
After digging all over the place, it really was as simple as adding theme support. Go figure, just add the following: //Adding theme support function mytheme_add_woocommerce_support() { add_theme_support( ‘woocommerce’ ); add_theme_support( ‘wc-product-gallery-zoom’ ); //Only if want woocommerce built in add_theme_support( ‘wc-product-gallery-lightbox’ );//Only if want woocommerce built in add_theme_support( ‘wc-product-gallery-slider’ );//Only if want woocommerce built in … Read more
Overall CODE issues: Your CODE is so wrong in so many ways that I shouldn’t even attempt to address them here. I suggest you study Official WordPress Theme Handbook properly before doing these sort of customizations. For the sake of the context, I’m ignoring other issues within your CODE and touching only the issues below: … Read more
WooCommerce styles the icon via this CSS file: woocommerce/assets/css/menu.css, and here’s the corresponding code (pretty-printed or actually, I copied it from woocommerce/assets/css/menu.scss): #adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before { font-family: ‘WooCommerce’ !important; content: ‘\e03d’; } So you can change the font-family and the content (and other) properties to suit your custom icon. Below is an example of … Read more
Like @Alvaro said, You should start building blocks for widget areas. Once Phase 2 hit the core you can just simply show the blocks in other areas. Don’t bother developing for Pre-Gutenberg widgets, You will double your work load.
I found a solution working for me by following this tutorial In Short: Create new file in plugin and copy Gamajo Template Loader Class Create another file, creating your own class extension of Gamajo <?php /** * Template loader for PW Sample Plugin. * * Only need to specify class properties here. * */ class … Read more
I think you probably want to use bp_core_get_user_domain(); I think bp_core_get_userurl() was taken out after the first release of BuddyPress.
This might work: add_filter(‘page_template’, ‘custom_page_template’); function custom_page_template($template){ // check your permalink here if(get_query_var(‘pagename’) === ‘stories’) return locate_template(array(‘page2.php’, ‘page.php’)); return $template; }
Use the following code, replacing the number after “child_of=” to the id of the parent page. <?php $count = 0; $pages = get_pages(‘child_of=681&depth=1’); foreach($pages as $page) { $count++; } echo $count; ?> Reference: get_pages