Skip to content

Instantly share code, notes, and snippets.

View ahmedeshaan's full-sized avatar

Ahmed Eshaan ahmedeshaan

View GitHub Profile
function my_shortcode_function_from_main_theme_for_dots($atts, $content = null, $tag) {
extract(shortcode_atts(array(
"_id" => 'row-'.rand(),
'style' => '',
'class' => '',
// Layout
"columns" => '4',
"columns__sm" => '1',
div.product-small .z-top {
z-index: 2;
}
<?php
add_filter('woocommerce_get_availability', 'availability_filter_func');
function availability_filter_func($availability)
{
$availability['availability'] = str_ireplace('Out of stock', 'Available soon', $availability['availability']);
return $availability;
}
<?php
function my_shortcode_function_from_main_theme(){
return "okey";
}
//add a custom shortcode
add_action( 'init', 'my_add_shortcodes' );
td[data-title="Shipping"]{max-width: 100px}
#eabi_postoffice_pickup_location {
width:270px !important;
}
<?php
add_action('init', function(){
remove_filter( 'lostpassword_url', 'wc_lostpassword_url', 10, 1 );});
[ux_banner height="364px" bg="11" bg_overlay="rgba(255, 255, 255, 0.87)" bg_pos="80% 19%" parallax="2"]
[text_box text_color="dark"]
<h3 class="uppercase"><strong>Portfolio Element</strong></h3>
<p>Showcase work or other elements</p>
[divider width="67px" height="5px"]
<?php
[/text_box]
<?php
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated) {
$translated = str_ireplace('Be the first to review', 'Sé el primero en comentar', $translated);
$translated = str_ireplace('There are no reviews yet', 'No hay comentarios aún', $translated);
// For More WooCommerce String Translation
//$translated = str_ireplace('english string', 'spanish string', $translated);
<?php
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated) {
$translated = str_ireplace('Be the first to review', 'Sé el primero en comentar', $translated);
return $translated;
}
// Or
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $deprecated1 = 0, $deprecated2 = 0 ) {
global $post;
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
if ( has_post_thumbnail() ) {
$props = wc_get_product_attachment_props( get_post_thumbnail_id(), $post );
return get_the_post_thumbnail( $post->ID, $image_size, array(
'title' => esc_attr(get_the_title()),
'alt' => esc_attr(get_the_title()),
) );