Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Agustin Mouratoglou amouratoglou

🎯
Focusing
View GitHub Profile
@amouratoglou
amouratoglou / shop_order_list_add_custom_field.php
Last active Apr 25, 2019
WP - WOO | Add custom field to shop_order Woocommerce Admin Order's List #wordpress #woocommerce
View shop_order_list_add_custom_field.php
<?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 Apr 19, 2019
WP - WOO | Add custom field to shop_order Woocommerce Admin Order's List + Search #Wordpress #Woocommerce
View add_column_with_custom_field_woocommerce_shop_order.php
<?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 Apr 19, 2019
WP - WOO | wp_query loop alphabetically sorted list with first letter before each
View wp_query_order_alphabetically_display_letter_woocommerce_wordpress.php
// 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 Apr 27, 2019
smooth scroll on click to anchor link jquery #js #jquery #smoothscroll
View smooth-scroll.js
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
@amouratoglou
amouratoglou / isMobile.js
Created Apr 29, 2019
Detect if is mobile and do something #javascript
View isMobile.js
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 Aug 13, 2019
Docker commands #docker
View docker.JS
// How To Remove Docker Containers, Images, Volumes, and Networks
// docker stop
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
View mongo.txt
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 Jun 1, 2020
Wp Woocommerce Subcategory Loop showing featured image in tumbnail size
View function_query_woocommerce_subcategory_thumbnail_featured_image.php
View rename_woocommerce_name_dashboard_menu_wordpress.php
// 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 Aug 3, 2019
Get AJAX posts in Wordpress #ajax #wordpress #javascript
View wordpress-ajax-load-posts.php
// 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',