This file contains hidden or 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
//og example | |
<?php if (is_singular( )) { ?> | |
<meta property="fb:app_id" content="<?php if( $mytheme['fb_app_id']!='') { | |
echo "background-color:" . $mytheme['fb_app_id']; } ?>" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:locale" content="ru_RU" /> | |
<meta property="og:title" content="<?php the_title( ); ?>" /> | |
<meta property="og:description" content="<?php echo get_the_excerpt(); ?>" /> | |
<meta property="og:url" content="<?php echo get_current_URL(); ?>"/> | |
<meta property="og:site_name" content="<?php bloginfo('name'); ?>"/> |
This file contains hidden or 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 | |
// get current URL | |
function get_current_URL() { | |
$current_url = 'http'; | |
$server_https = $_SERVER["HTTPS"]; | |
$server_name = $_SERVER["SERVER_NAME"]; | |
$server_port = $_SERVER["SERVER_PORT"]; | |
$request_uri = $_SERVER["REQUEST_URI"]; | |
if ($server_https == "on") $current_url .= "s"; | |
$current_url .= "://"; |
This file contains hidden or 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
#close listing for files and folders | |
#Options +FollowSymLinks -Indexes | |
RewriteEngine On | |
# Block out any script trying to base64_encode data within the URL. | |
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] | |
# Block out any script that includes a <script> tag in URL. | |
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] | |
# Block out any script trying to set a PHP GLOBALS variable via URL. |
This file contains hidden or 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_filter('request', 'change_term_request', 1, 1 ); | |
function change_term_request($query){ | |
$tax_name = 'category'; | |
if( $query['attachment'] ) : | |
$include_children = true; | |
$name = $query['attachment']; | |
else: | |
$include_children = false; |
This file contains hidden or 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_filter('style_loader_tag', 'dark_theme_remove_type_attr', 10, 2); | |
add_filter('script_loader_tag', 'dark_theme_remove_type_attr', 10, 2); | |
function dark_theme_remove_type_attr($tag, $handle) { | |
$tag = str_replace( 'type="text/javascript"', '', $tag); | |
$tag = str_replace( "type='text/javascript'", '', $tag); | |
$tag = str_replace( 'type="text/css"', '', $tag); | |
$tag = str_replace( "type='text/css'", '', $tag); | |
return $tag; | |
} |
This file contains hidden or 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( 'init', 'dark_remove_emoji' ); | |
function dark_remove_emoji() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); | |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); | |
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' ); |
This file contains hidden or 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
<div id="map" style="height: 500px;"></div> | |
<script> | |
function initMap() { | |
var locations = [ | |
['InfoWindow Content', -33.890542, 151.274856,], | |
['InfoWindow Content', -33.923036, 151.259052,], | |
['InfoWindow Content', -34.028249, 151.157507,], | |
['InfoWindow Content', -33.800101, 151.287478,], | |
['InfoWindow Content', -33.950198, 151.259302,] | |
]; |
This file contains hidden or 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 | |
final class WP_Gutenberg_Reusable_Blocks_Widgets { | |
private static $instance; | |
public static function instance() { | |
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WP_Gutenberg_Reusable_Blocks_Widgets ) ) { | |
self::$instance = new WP_Gutenberg_Reusable_Blocks_Widgets; | |
self::$instance->initing(); |
This file contains hidden or 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
// functions.php | |
add_filter( 'embed_oembed_html', function ($html, $url, $attr, $post_ID) { | |
$youtube_pattern = '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#'; | |
if ( preg_match( $youtube_pattern, $url ) ) { | |
$html = str_replace( 'src="', 'class="lazy-youtube" src="" data-src="', $html); | |
} | |
return $html; | |
}, 11, 4); | |
//js |