Skip to content

Instantly share code, notes, and snippets.

View alidemirci's full-sized avatar
🎯
Focusing

alidemirci

🎯
Focusing
View GitHub Profile
add_filter( 'wp_nav_menu_objects', 'amc_filter_menu', 10, 2 );
/**
* Filters to remove Home Link on Front Page
*/
function amc_filter_menu( $objects, $args ) {
// Return Default Value if the Menu isn't Main Menu
// Replace "Navigation_location" with your target location
if ( 'Navigation_location' !== $args->theme_location ) {
return $objects;
// This action will help you to add excerpt to the product archive page
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 20 );
// This action will help you to add excerpt to the product archive page
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 20 );
// This action will help you to add excerpt to the product archive page
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 20 );
@alidemirci
alidemirci / Change WooCommerce Text String
Created March 5, 2020 12:58
Change WooCommerce Text String
/*
*
* Change WooCommerce Text String
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
*/
function amc_change_woo_string( $translation, $text, $domain ){
@alidemirci
alidemirci / Change "Sold Out" text with another text in WooCommerce with Filter
Last active March 5, 2020 13:02
Change "Sold Out" text with another text in WooCommerce with Filter
add_filter( 'woocommerce_get_availability_text', 'amc_change_out_of_stock_text', 10, 2 );
function amc_change_out_of_stock_text( $availability, $product ){
if ( ! $product->is_in_stock() ) {
$availability = __( 'in de winkelmand', 'woocommerce' );
}
@alidemirci
alidemirci / Update All WooCommerce product SKUs
Last active March 5, 2020 13:03
Update All WooCommerce product SKUs
// Please paste this code to your theme function file
// Go to Admin Panel and refresh for once
// Then remove this code from functions file
add_action( 'init', 'amc_update_all_sku' );
function amc_update_all_sku(){
$products = wc_get_products( array(
@alidemirci
alidemirci / Disable WooCommerce Payment Method for Specific Country
Last active March 5, 2020 13:03
Disable WooCommerce Payment Method for Specific Country
apply_filters( 'woocommerce_available_payment_gateways', $_available_gateways );
add_filter( 'woocommerce_available_payment_gateways', 'amc_remove_payment_method');
function amc_remove_payment_method( $_available_gateways ){
if( class_exists( 'WooCommerce' ) ) :
// Get All Payment Methods
$payments = $_available_gateways;
WP Araçları
https://generatewp.com/
Requirements
WP.org https://make.wordpress.org/themes/handbook/review/required/
Themeforest https://help.author.envato.com/hc/en-us/articles/360000472383-WordPress-Theme-Requirements
Test
https://tr.wordpress.org/plugins/theme-check/
https://github.com/WPTRT/theme-sniffer