SQL order by fields
SELECT * FROM wp_posts WHERE ID IN (5,26,4) ORDER BY FIELD(ID,5,26,4)
All of the codes below will be place on your function.php Change number of products displayed per page add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 1000;' ), 20 ); Archive columns global $woocommerce_loop; $woocommerce_loop['columns'] = 4; // Change the product category list column to 4. Archive columns with body class add_filter('body_class','archive_columns'); function archive_columns($classes) { global $woocommerce_loop; $classes[]…
How to get the category ID of the current post? Just copy the codes below and paste it into your .php file. $category = get_the_category( get_the_ID() ); $category_ID = $category[0]->term_id; Another problem is, what if the category ID is a sub category and you need the parent category ID? For Example, the current category ID…
Where ‘style-woocommerce’ is the ID of your stylesheet and get_stylesheet_directory_uri().’/style-woocommerce.css’ is your .css DIR. wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style( 'style-woocommerce' ); Function below is for woocommerce page css only. This will show on woocommerce pages else is not. add_action( 'wp_enqueue_scripts','home_scripts' ); function home_scripts(){ If( is_shop() || is_product_category() || is_product() ){ wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style(…
On my current, I have this “martygeocoderaddress” custom fields and it contains a string with Queen Anne’s. On my JS code below Wrong html += ''; html += '<?php echo get_post_meta( $product->id , 'martygeocoderaddress' , true ); ?>'; // Output is 'Queen Anne's' which is wrong and this can't be read by your JS code….
Use the `[anton-accordion]` to display the shortcode in your pages. To use the specific category of your accordion, use the `cat` attributes. Use the category value in `cat` attributes. [anton-accordion cat=”1″] // 1 is the category ID
If you encountered the same error just like the image above, just follow this instructions. Steps: 1. Open your cpanel and look for /wp-admin/ folder. 2. Create a file and name it to .user.ini. 3. Copy the codes below and save the file. max_input_vars = 5000; max_execution_time = 180; 4. Make sure to switch your…