Skip to content

Instantly share code, notes, and snippets.

View amouratoglou's full-sized avatar
🤗

Agustin Mouratoglou amouratoglou

🤗
View GitHub Profile
@amouratoglou
amouratoglou / shop_order_list_add_custom_field.php
Last active April 25, 2019 16:13
WP - WOO | Add custom field to shop_order Woocommerce Admin Order's List #wordpress #woocommerce
<?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 ) {
@amouratoglou
amouratoglou / add_column_with_custom_field_woocommerce_shop_order.php
Last active April 19, 2019 18:07
WP - WOO | Add custom field to shop_order Woocommerce Admin Order's List + Search #Wordpress #Woocommerce
<?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
*/
@amouratoglou
amouratoglou / wp_query_order_alphabetically_display_letter_woocommerce_wordpress.php
Last active April 19, 2019 18:04
WP - WOO | wp_query loop alphabetically sorted list with first letter before each
// 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,
@amouratoglou
amouratoglou / smooth-scroll.js
Created April 27, 2019 17:06
smooth scroll on click to anchor link jquery #js #jquery #smoothscroll
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
@amouratoglou
amouratoglou / isMobile.js
Created April 29, 2019 12:15
Detect if is mobile and do something #javascript
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;
@amouratoglou
amouratoglou / docker.JS
Last active August 13, 2019 15:13
Docker commands #docker
// How To Remove Docker Containers, Images, Volumes, and Networks
// docker stop
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@amouratoglou
amouratoglou / mongo.txt
Last active May 28, 2019 19:01
mongo shell
MONGO SHELL
---------------------------
mongo "mongodb+srv://clustertest-rrpc1.mongodb.net/test" --username m001-student
password
show dbs
use [databasename]
@amouratoglou
amouratoglou / function_query_woocommerce_subcategory_thumbnail_featured_image.php
Last active June 1, 2020 22:24
Wp Woocommerce Subcategory Loop showing featured image in tumbnail size
// Rename WooCommerce to Store in the dashboard
// add this function to your functions.php file
// or create a plugin with it.
add_action( 'admin_menu', 'rename_woocoomerce', 999 );
function rename_woocoomerce()
{
global $menu;
@amouratoglou
amouratoglou / wordpress-ajax-load-posts.php
Last active August 3, 2019 00:34
Get AJAX posts in Wordpress #ajax #wordpress #javascript
// 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',