Skip to content

Instantly share code, notes, and snippets.

@DevTarakanova
DevTarakanova / .php
Created November 15, 2018 13:10
Add template part
<?php get_template_part('parts/name_section'); ?>
@DevTarakanova
DevTarakanova / .php
Last active November 13, 2018 20:30
Background image to section
<?php $image = get_field('background_img'); ?>
<section class="name_section" <?php bg($image) ?>></section>
@DevTarakanova
DevTarakanova / custom-editor-style.css
Last active November 13, 2018 20:18
Add style for button to WSVC
.custom_button {
line-height: 35px;
padding: 0 20px;
border-radius: 4px;
background: #954b52;
color: black;
display: inline-block;
text-decoration: none;
}
@DevTarakanova
DevTarakanova / functions.php
Last active November 13, 2018 20:19
Add button to WSVC
// Callback function to insert 'styleselect' into the $buttons array
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// Register our callback to the appropriate filter
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
@DevTarakanova
DevTarakanova / functions.php
Created November 13, 2018 19:15
Add Google fonts to editor
// Add Google fonts to editor
add_action( 'after_setup_theme', 'leaven_editor_fonts' );
function leaven_editor_fonts() {
$font_url = str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Open+Sans:300,400,700|Lora:400italic,700italic' );
add_editor_style( $font_url );
}
@DevTarakanova
DevTarakanova / functions.php
Last active November 13, 2018 20:12
Customize WSVC editor font sizes
// Create a function that adds the font selector
if (!function_exists('PREFIX_mce_buttons')) {
function PREFIX_mce_buttons($buttons)
{
array_unshift($buttons, 'fontsizeselect'); // Add Font Size Select
return $buttons;
}
}
// Hook the function the mce buttons event
@DevTarakanova
DevTarakanova / .php
Last active November 27, 2018 11:53
shortcode for gravityform
<?php
$form_object = get_field('your_form_field');
echo do_shortcode('[gravityform id="' . $form_object['id'] . '" title="true" description="true" ajax="true"]');
?>
@DevTarakanova
DevTarakanova / .js
Created October 27, 2018 15:52
off AOS on responsive
AOS.init({ disable: 'mobile' });
@DevTarakanova
DevTarakanova / .Js
Created October 27, 2018 14:00
Sticky Header
<script>
window.onscroll = function() {myFunction()};
var header = document.getElementById("header");
var sticky = header.offsetTop;
function myFunction() {
if (window.pageYOffset > sticky) {
header.classList.add("sticky");
} else {
@DevTarakanova
DevTarakanova / .css
Created October 4, 2018 19:39
КРАСИВОЕ CSS ПОДЧЕРКИВАНИЕ ЭЛЕМЕНТОВ
a{
display: inline-block;
position: relative;
text-decoration: none;
}
a::before{
display: block;
position: absolute;
content: "";