This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a new Column to shop_order | |
* admin list Woocommerce and show custom fields | |
* Use in functions.php | |
*/ | |
function add_new_column_orders_woo( $columns ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* Add a new Column to shop_order | |
* admin list Woocommerce and show custom fields | |
* add support to search custom field | |
* | |
* Use in functions.php | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Originally used inside /woocommerce/ folder in my child theme to display a product_category terms list. | |
// Displays terms separated by first letter and before each series inserts the main letter, like a index. | |
// Settings order by title, only showing child subcategories of those terms that have posts assigned. | |
// Place in your page-template.php and customise the arguments to fit your needs. | |
$args = array( | |
'taxonomy' => 'product_cat', | |
'hide_empty' => true, | |
'posts_per_page' => 300, | |
'parent' => 77, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a').click(function(){ | |
$('html, body').animate({ | |
scrollTop: $( $.attr(this, 'href') ).offset().top | |
}, 500); | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isMobile() { | |
if (navigator.userAgent.match(/Mobi/)) { | |
return true; | |
} | |
if ('screen' in window && window.screen.width < 1366) { | |
return true; | |
} | |
var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How To Remove Docker Containers, Images, Volumes, and Networks | |
// docker stop | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MONGO SHELL | |
--------------------------- | |
mongo "mongodb+srv://clustertest-rrpc1.mongodb.net/test" --username m001-student | |
password | |
show dbs | |
use [databasename] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// function can be placed in functions.php and then you can use on template files | |
// the following function, passing the ID of parent category | |
woocommerce_subcats_from_parentcat_by_ID($parent_cat_ID); | |
function woocommerce_subcats_from_parentcat_by_ID($parent_cat_ID) { | |
// custom parameters | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the function returns HTML directly using a custom template | |
// add this to your functions.php or create a plugin | |
function get_ajax_posts() | |
{ | |
// Query Arguments | |
$args = array( | |
'post_type' => 'post', |
OlderNewer