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'];
How to check radio button if checked or not? if( $("input#myradio-id").is(":checked") ){ // IF CHECKED CODES }else{ // IF NOT CHECKED CODES } Navigation menu on-click prevent default if menu item has children and fires only on second click // OPTION 1 // JQUERY $( '.menu-item-has-children a' ).click( function(e){ $( this ).parent().toggleClass( 'active-li' ); if(…
How to control the post displayed on a specific category? You can solve this problem by simply copy the codes below on your functions.php file. function category_blog_posts_per_page( $query ) { if ( is_admin() || ! $query->is_main_query() ){ return; } if( is_category( 1 ) ){ $query->set( 'posts_per_page', 15 ); } } add_action( 'pre_get_posts', 'category_blog_posts_per_page', 1 );
Copy this code to your wp-config.php of your WordPress folder. define( 'WP_CONTENT_DIR', '/home/site-folder/public_html/custom-wp-content-name-content' ); define( 'WP_CONTENT_URL', 'http://site.com/custom-wp-content-name-content' );
Update via wp-config.php define('WP_HOME', 'http://www.example.local'); define('WP_SITEURL', 'http://www.example.local'); Update via functions.php update_option('siteurl','http://www.example.local'); update_option('home','http://www.example.local');
The7 social network share button open new window instead of new tab. Copy the codes below to your JS file. $('.soc-ico a' ).click(function(e){ e.preventDefault(); window.open(this.href, "myWindowName", "width=800, height=600"); });
jQuery click event is not working when using .clone() or ajax. You can’t fire a click event after your element is loaded? I found the solutions below. [php] jQuery( document ).ready(function($) { $(document).delegate(“#my-clone-id”, ‘click’, function() { $(this).clone().appendTo( “body” ); }); }); [php]