Skip to content

Instantly share code, notes, and snippets.

Avatar

Sergey Mochalov proweb

View GitHub Profile
@proweb
proweb / icon.js
Last active Nov 17, 2021
VK render in Yootheme builder
View icon.js
UIkit.icon.add('vk','<svg height="20px" style="enable-background:new 0 0 20 20;" version="1.1" viewBox="0 0 512 512" width="20px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="comp_x5F_364-vk"><g><path d="M475.515,137.899c3.16-10.674,0-18.53-15.2-18.53h-50.297c-12.809,0-18.702,6.746-21.861,14.261 c0,0-25.617,62.422-61.825,102.899c-11.698,11.699-17.078,15.457-23.482,15.457c-3.158,0-8.027-3.758-8.027-14.432v-99.655 c0-12.809-3.588-18.53-14.176-18.53h-79.075c-8.027,0-12.809,5.978-12.809,11.528c0,12.125,18.104,14.943,19.983,49.101v74.123 c0,16.225-2.904,19.212-9.308,19.212c-17.079,0-58.581-62.678-83.174-134.409c-4.952-13.919-9.821-19.555-22.715-19.555H43.25 c-14.346,0-17.25,6.746-17.25,14.261c0,13.32,17.079,79.502,79.502,166.945c41.587,59.689,100.167,92.056,153.453,92.056 c32.022,0,35.951-7.173,35.951-19.555c0-57.045-2.903-62.425,13.152-62.425c7.428,0,20.237,3.757,50.127,32.534 c34.155,34.158,39.792,49.445,58.92,49.445h50.297c14.347,0,21.606-7.173,17.421
@proweb
proweb / blur.css
Created Mar 12, 2020
How to make a background blur in CSS with one line of code
View blur.css
backdrop-filter: blur(5px);
View remove-gutenberg-css.php
//kill Gutenberg stylesheet
function wp_dequeue_gutenberg_styles() {
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
}
add_action( 'wp_print_styles', 'wp_dequeue_gutenberg_styles', 100 );
@proweb
proweb / redirect-to-child.php
Created Dec 25, 2019 — forked from neverything/redirect-to-child.php
WordPress redirection page template to the first child page (menu_order) with WPML handling
View redirect-to-child.php
<?php
/**
* Template Name: Redirect to child page
* Description: Redirects to the top child page
*
* @package PUT YOUR THEME NAME HERE :D
*/
global $post;
@proweb
proweb / functions.php
Created Sep 24, 2019
Remove WordPress images sizes - all except thumbnail
View functions.php
<?php
add_action( 'after_switch_theme', 'theme_activated' );
add_filter( 'intermediate_image_sizes_advanced', 'remove_default_sizes');
function theme_activated() {
// Set thumbnail size in settings > media.
update_option( 'thumbnail_size_w', 150 );
update_option( 'thumbnail_size_h', 150 );
update_option( 'thumbnail_crop', 1 );
@proweb
proweb / params
Last active Mar 14, 2019 — forked from Vlasterx/Joomla fields
All field types for Joomla CMS
View params
<fieldset name="ADMIN_TEST">
<field name="access" type="accesslevel" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" class="span12 small" />
<field name="cache_handler" type="cachehandler" default="" label="Cache Handler Field type" description="COM_CONFIG_FIELD_CACHE_HANDLER_DESC" filter="word" />
<field name="mycalendar" type="calendar" default="5-10-2008" label="Select a date" description="" format="%d-%m-%Y" />
<field name="captcha" type="plugins" folder="captcha" label="Captcha Selection field" description="COM_CONTACT_FIELD_CAPTCHA_DESC" default="" filter="cmd">
<option value="">JOPTION_USE_DEFAULT</option>
<option value="0">JOPTION_DO_NOT_USE</option>
</field>
<field name="mycategory" type="category" extension="com_content" label="Select a category" description="" />
<field name="show_title" type="checkbox" label="Show title" description="Show the title of the item" value="1" />
@proweb
proweb / index.html
Last active Mar 24, 2021
Как разместить две формы Битрикс 24 на сайте.
View index.html
<div id="my_container"></div> <!-- Form container -->
<!-- JS code from CRM Bitrix24 -->
<!-- Added "node" parametr -->
<script id="bx24_form_inline" data-skip-moving="true">
(function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u;
(w[b].forms=w[b].forms||[]).push(arguments[0])};
if(w[b]['forms']) return;
s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r;
h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'http://cp.silaev.bx/bitrix/js/crm/form_loader.js','b24form');
@proweb
proweb / post.php
Last active Aug 23, 2017
Core post types in Wordpress [wp-includes/post.php]
View post.php
<?php
/**
* Core Post API
*
* @package WordPress
* @subpackage Post
*/
//
// Post Type Registration
@proweb
proweb / template-functions.php
Last active Dec 16, 2018
Add class to post_class function wordpress (as last class)
View template-functions.php
<?php
add_filter( 'post_class', 'uikit_article_class' );
function my_article_class($classes) {
if (!is_admin()) {
$classes[] = 'my-class';
return $classes;