Skip to content

Instantly share code, notes, and snippets.

View artikus11's full-sized avatar
🥕
Create plugins

Artem Abramovich artikus11

🥕
Create plugins
View GitHub Profile
@artikus11
artikus11 / style.css
Last active January 12, 2022 16:16
Скрытие бейджа от recapcha v.3
.grecaptcha-badge {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
@artikus11
artikus11 / .htaccess
Created May 16, 2019 22:02 — forked from seoagentur-hamburg/.htaccess
UPDATE 2019: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
function shop_loop_sizes_news() {
$product = wc_get_product();
$attributes = array();
$variation_id = '';
if ( 'simple' === $product->get_type() ) {
$attributes = get_the_terms( $product->get_id(), 'pa_size' );
} else {
$(document).on('click', '.js-preview-add-to-cart', function (event) {
var $thisbutton = $(this);
var product_id = $(this).attr('data-product-id');
if (variation_id != 0 && typeof variation_id !== 'undefined') {
variation_id = variation_id;
} else {
variation_id = product_id;
}
// console.log(variation_id);
@artikus11
artikus11 / functions.php
Last active March 3, 2019 17:51
Шорткод вывода одной новой записи с картинкой и описанием
add_shortcode( 'art_one_new_post', 'one_new_post_function' );
function one_new_post_function ($atts){
$atts = shortcode_atts(
array(
'id' => '',
'count' => 1,
),
$atts
);
add_action( 'woocommerce_single_product_summary', 'artabr_link_to_current_category', 35 );
function artabr_link_to_current_category() {
$product = wc_get_product();
$terms = get_the_terms( $product->ID, 'product_cat' );
if ( $terms ) {
$term = array_shift( $terms );
?>
<a href="<?php echo esc_url( get_term_link( $term->term_id ) ); ?>">Назад</a>
.tree-col{
display: flex;
-webkit-flex-flow: column wrap;
-moz-flex-flow: column wrap;
-ms-flex-flow: column wrap;
flex-flow: column wrap;
}
.product div.summary {
width: calc(100% - 400px - 400px - 50px) !important;
add_shortcode('wp_caption', 'wpruse_custom_img_caption_shortcode');
add_shortcode('caption', 'wpruse_custom_img_caption_shortcode');
function wpruse_custom_img_caption_shortcode( $attr, $content = null ) {
// New-style shortcode with the caption inside the shortcode with the link and image tags.
if ( ! isset( $attr['caption'] ) ) {
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
$content = $matches[1];
$attr['caption'] = trim( $matches[2] );
}
} elseif ( strpos( $attr['caption'], '<' ) !== false ) {
@artikus11
artikus11 / custom-control.css
Last active October 29, 2018 09:41
Кастомный контрол для добавления слайдера картинок в кастомайзер
/* ==========================================================================
Slider Images
========================================================================== */
.repeat_block .dashicons.dashicons-no-alt:hover{
color: red;
}
.repeatable {
margin-bottom: 7px;
counter-reset: items;
@artikus11
artikus11 / functions.php
Last active January 12, 2022 16:20
Быстрый хак добавления формы из AnyComment в WooCommerce.
/**
* Get form AnyComment
*/
function woo_anycomment() {
echo do_shortcode( '[anycomment include="true"]' );
}
/**
* Get tabs reviews to AnyComment
*