Skip to content

Instantly share code, notes, and snippets.

View assoscoupa's full-sized avatar
🏠
Working from home

Paris Koutroumanos assoscoupa

🏠
Working from home
View GitHub Profile
@assoscoupa
assoscoupa / gist:e52dac4bc62bce6114360e01baaa7231
Last active March 26, 2023 20:49 — forked from shubhw12/gist:12f204c61b7d5854507a124676159816
Display tags below post in Astra Theme
add_filter( 'astra_post_tags', 'remove_tags_callback' );
function remove_tags_callback(){
return ' ';
}
add_action( 'astra_entry_after' , 'add_tags_callback');
function add_tags_callback(){
@assoscoupa
assoscoupa / wc-add-order-notes-to-admin-emails
Created April 21, 2021 17:11 — forked from vanbo/wc-add-order-notes-to-admin-emails
WooCommerce: Add Order notes to admin emails
add_action( 'woocommerce_email_order_meta', 'woo_add_order_notes_to_email', 10, 3 );
function woo_add_order_notes_to_email( $order, $sent_to_admin = true, $plain_text = false ) {
// You want to send those only to the Admin
if ( ! $sent_to_admin ) {
return;
}
// You can also check which email you are sending, by checking the order status
// Optional, comment it out, if not needed
@assoscoupa
assoscoupa / wp-paths.php
Created April 19, 2021 06:13 — forked from Yiannistaos/wp-paths.php
Determining Plugin and Content Directories in WordPress (Cheat Sheet)
<?php
echo "<h1>Determining Plugin and Content Directories in WordPress (Cheat Sheet)</h1>";
# PLUGINS
echo "<h2>PLUGINS</h2>";
echo plugins_url(). "<br>"; # http://wordpress.test/wp-content/plugins
echo plugins_url('akismet'). "<br>"; # http://wordpress.test/wp-content/plugins/akismet
echo plugins_url( 'assets/js/myscript.js', __FILE__ ). "<br>"; # http://wordpress.test/wp-content/plugins/assets/js/myscript.js
echo plugin_dir_url('') . "<br>"; # http://wordpress.test/wp-content/plugins/
@assoscoupa
assoscoupa / functions.php
Created April 17, 2021 07:52 — forked from premanshup/functions.php
Change the default row and col value of Textarea for comment in Astra
add_filter( 'astra_comment_form_default_markup', 'astra_edit_comment_textarea_row_col' );
function astra_edit_comment_textarea_row_col( $args ) {
$args['comment_field'] = '<div class="ast-row comment-textarea"><fieldset class="comment-form-comment"><div class="comment-form-textarea ast-col-lg-12"><label for="comment" class="screen-reader-text">' . esc_html( astra_default_strings( 'string-comment-label-message', false ) ) . '</label><textarea id="comment" name="comment" placeholder="' . esc_attr( astra_default_strings( 'string-comment-label-message', false ) ) . '" cols="5" rows="5" aria-required="true"></textarea></div></fieldset></div>';
return $args;
}
@assoscoupa
assoscoupa / wc-exclude-product-category-from-shop-page.php
Created March 13, 2021 21:01 — forked from stuartduff/wc-exclude-product-category-from-shop-page.php
This snippet will exclude all products from any categories which you choose from displaying on the WooCommerce Shop page.
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'clothing' ), // Don't display products in the clothing category on the shop page.
'operator' => 'NOT IN'
);
@assoscoupa
assoscoupa / WooCommerce: Remove related products when up-sell products are defined
Last active May 18, 2020 12:34
WooCommerce: Remove related products when up-sell products are defined