Product categories WordPress codex
How to get current product category slug?
global $wp_query; echo $wp_query->query_vars['product_cat'];
How to get current product category slug?
global $wp_query; echo $wp_query->query_vars['product_cat'];
WordPress page options resetting after pressing the enter keys and all of your settings go back to zero. This is usually this is happening when you create a custom page option in WordPress dashboard. The main reason is the reset button is declared ahead or coded before submit button. If you can see the `id=”reset”`…
Step 1 Think about the name of your plugin. Step 2 Example is Shortcode URL plugin. Create a shortcode-url folder name inside of wp-content/plugins/. Step 3 Create shortcode-url.php file inside wp-content/plugins/ folder and put the codes below inside of your shortcode-url.php file. <?php /** * Plugin Name: Shortcode URL * Plugin URI: https://www.anthonypagaycarbon.com/ * Description: Shortcode URL is…
Put this code to your .htaccess file. <FilesMatch "\\.(js|css|html|htm|php|xml)$"> SetOutputFilter DEFLATE </FilesMatch> <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule> # Leverage browser caching <FilesMatch "\.(woff|ico|pdf|jpg|jpeg|png|gif|js)$"> Header set Cache-Control "max-age=864000, public, must-revalidate" </FilesMatch> or <IfModule mod_expires.c> ExpiresActive On…
Option 1 add_filter( ‘genesis_pre_get_option_site_layout’, ‘genesiscustomlayout’ ); function genesiscustomlayout(){ $pageobj = get_queried_object(); $pageid = absint($pageobj->ID); $pagelayout = get_post_meta($pageid , "_genesis_layout" , true); return $pagelayout; } Option 2 This function is to forced your custom post type content layout to full width. Common post type is post, page, and product ( woocommerce plugin pages ) and etc….
Add column classes and add first class in every first column. Just change the _index = ( _index + 3 ); to your custom column. Example, if you want to create 5 columns change the _index + 3 to _index + 4 if you want to create 6 columns change the _index + 3 to…
Copy this code and paste to your functions.php function wpa54064_inspect_scripts() { global $wp_scripts; print_r($wp_scripts); // this will show all enqueue’s script } add_action( ‘wp_head’, ‘wpa54064_inspect_scripts’ );