Skip to content

Instantly share code, notes, and snippets.

@Volodymyr75
Volodymyr75 / код для эдж и ие11 10
Created April 23, 2020 15:08
css and js for edge ie11 10
@media all and (-ms-high-contrast:none)
{
#img_header_ru img {
width: 180px!important;
} /* IE10 */
*::-ms-backdrop, #img_header_ru img {
width: 180px!important;
} /* IE11 */
}
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@Volodymyr75
Volodymyr75 / wp_ext_pll_functions.php
Created August 17, 2019 14:23 — forked from icetee/wp_ext_pll_functions.php
Polylang function_exists (active the plugin) - WordPress - Paste the code into functions.php
/*
* Polylang Language API functions tester - WordPress
* Github: https://gist.github.com/icetee/fbbfef5534fead58611e
*
*/
function ex_pll_the_languages($arg = '') {
if ( function_exists('pll_the_languages') ) {
return pll_the_languages($arg);
}
@Volodymyr75
Volodymyr75 / Replace holder in search form
Created July 25, 2019 13:04
wordpress filter placeholder
add_filter('get_search_form', 'my_search_form_text');
function my_search_form_text($html) {
if(pll_current_language() == 'uk') {
$html = str_replace( 'placeholder="Search ', 'placeholder="Пошук ', $html );
return $html;
}
}
@Volodymyr75
Volodymyr75 / wordpress polylang menu
Created July 17, 2019 11:39
register menu for polylang
register_nav_menus(
array(
'primary' => __('Primary Menu', 'riola'),//important
'second' => __('Second Menu', 'riola')//important
)
);
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
// Get WooCommerce product price by ID via shortcode: [iw_product_price id='']
function iw_product_price_shortcode( $atts ) {
$atts = shortcode_atts( array(
'id' => null,
), $atts, 'bartag' );
$html = '';
if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){
$_product = wc_get_product( $atts['id'] );
@Volodymyr75
Volodymyr75 / woocommerce currency
Created June 6, 2019 18:51
замена значка валюты на текст
/**
* Замена значка гривны на текст
*/
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['UAH'] = __( 'Українська гривня', 'woocommerce' );
@Volodymyr75
Volodymyr75 / wordpress media id admin
Last active May 21, 2019 06:48
add id to media in admin wordpress
// добавляем вывод id в админке для всех медиафайлов
add_filter('manage_media_columns', 'posts_columns_attachment_id', 1);
add_action('manage_media_custom_column', 'posts_custom_columns_attachment_id', 1, 2);
function posts_columns_attachment_id($defaults){
$defaults['wps_post_attachments_id'] = __('ID');
return $defaults;
} //добавляем функцию
function posts_custom_columns_attachment_id($column_name, $id){
if($column_name === 'wps_post_attachments_id'){
echo $id;
@Volodymyr75
Volodymyr75 / flex, space-between, move to left
Created April 5, 2019 17:01
флекс придавливаем блок влево, при justify-content:space-between
<div class="s-about__links">
<a href="about_us.html" class="s-about__box">
</a>
<a href="news.html" class="s-about__box">
<div class="s-about__img">
</a>
<a href="gardens.html" class="s-about__box">
@Volodymyr75
Volodymyr75 / pop-up modal form
Last active November 6, 2018 07:44
всплывающее модальное окно
<div class="overlay" id="overlay">
<div class="overlay-background" id="overlay-background"></div>
<div class="overlay-content1" id="overlay-content1"></div>
<div class="overlay-content2" id="overlay-content2"></div>
</div
$("#popup-ask, #popup-ask-btn").on("click", function(event) {
event.preventDefault();
$('#overlay').addClass('open');