Skip to content

Instantly share code, notes, and snippets.


Agustin Mouratoglou amouratoglou

View GitHub Profile
amouratoglou / wp-combine-two-arrays-post-types-re-order-and-render.php
Last active Jun 3, 2021
Wordpress PHP Combine two wp queries of different post types - merge 2 arrays and sort by date
View wp-combine-two-arrays-post-types-re-order-and-render.php
// first query
$first_ids = get_posts( array(
'post_status'=> 'publish',
'orderby' => 'date',
'post_type'=> 'press',
'posts_per_page' => -1,
'order' => 'DESC',
amouratoglou / woocommerce-taxonomy-term-list-with-featured-image-for-loop.php
Last active Jun 1, 2020
Woocommerce Taxonomy Term list with featued image for loop
View woocommerce-taxonomy-term-list-with-featured-image-for-loop.php
amouratoglou /
Last active Feb 8, 2020
Javascript Promises and Async Programming


This document has notes related with Javascript Promises and Async Programming

Promises in Javascript

  • Async Programming
  • Consuming and creating promises
  • Async Await
amouratoglou / array-key-value-foreach.php
Created Nov 24, 2019
Output array key and value foreach loop php
View array-key-value-foreach.php
$books["978"] = "Jjaj";
$books["978"] = "The Pepe";
$books["978"] = "Jackie's Fables";
$books["978"] = "Mahabhartazaa";
amouratoglou / woocommerce_sql_scripts.sql
Last active Sep 11, 2019
Woocommerce product management SQL scripts
View woocommerce_sql_scripts.sql
Make sure you execute the script in the right database!
- Delete all products -
Description: This script deletes all WooCommerce products
and their associations (categories/taxonomies and terms info)
DELETE relations.*, taxes.*, terms.*
amouratoglou / wordpress_taxonomy_term_title_and_slug
Last active Aug 19, 2019
Wordpress Show Taxonomy Term Title and Slug inside loop #wordpress
View wordpress_taxonomy_term_title_and_slug
// Print term slug
$terms = get_the_terms( $post->ID , 'oil' );
if ( $terms != null ){
foreach( $terms as $term ) {
print $term->slug ;
} }
// Get term title
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',
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 / 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