This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( false !== strpos( $content, '<table' ) ) { | |
$rep = preg_replace('~<table\K(?:[^>]*?\K(\s?)class="([^"]*)")?~', ' class="$2$1table"', $rep); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'genesis_entry_content', 'featured_post_image', 8 ); | |
function featured_post_image() { | |
if ( !is_singular( array( 'post', 'page' ) )) return; | |
the_post_thumbnail('featured'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit','1024M'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_page_for_posts() { | |
$result = false; | |
if ( is_home() && ! is_front_page() ) { | |
$page = get_queried_object(); | |
$result = ! is_null( $page ) && $page->ID == get_option( 'page_for_posts' ); | |
} | |
return $result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findPoint : function () { | |
var envs = ['xs', 'sm', 'md', 'lg']; | |
$el = $('<div>'); | |
$el.appendTo($('body')); | |
for (var i = envs.length - 1; i >= 0; i--) { | |
var env = envs[i]; | |
$el.addClass('hidden-'+env); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('click', '.multitext', function () { | |
var range = document.createRange(); | |
range.selectNodeContents(this); | |
window.getSelection().addRange(range); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function yoast_clear_sitemap( $output, $url ) { | |
$timezone = new WPSEO_Sitemap_Timezone(); | |
$date = null; | |
if ( ! empty( $url['mod'] ) ) { | |
$date = $timezone->format_date( $url['mod'] ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vimeoSettings : function () { | |
var wa = 16, // Соотношение сторон | |
ha = 9, // Соотношение сторон | |
$videoBlock = $('.vimeo-video'), // Блок внутри которого лежит iframe | |
od = $videoBlock.width()/$videoBlock.height(), | |
vd = wa/ha, | |
nvh = (od/vd)*100, | |
nvw = (vd/od)*100; | |
if (od>vd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_youtube_id( $url = '' ) { | |
$url = preg_replace('~https?://(?:[0-9A-Z-]+\.)?(?:youtu\.be/| youtube(?:-nocookie)?\.com\S*?[^\w\s-])([\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:[\'"][^<>]*>| </a>))[?=&+%\w.-]*~ix', '$1', $url); | |
return $url; | |
} |