Skip to content

Instantly share code, notes, and snippets.

Irina Blumenfeld netmagik

Block or report user

Report or block netmagik

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@netmagik
netmagik / post-grid.php
Created Aug 29, 2017
Customize Beaver Builder Posts Module to hide author username
View post-grid.php
<?php if ( 'columns' == $settings->layout ) : ?>
<div class="fl-post-column">
<?php endif; ?>
<div <?php $module->render_post_class(); ?> itemscope itemtype="<?php FLPostGridModule::schema_itemtype(); ?>">
<?php FLPostGridModule::schema_meta(); ?>
<?php $module->render_featured_image( 'above-title' ); ?>
<div class="fl-post-grid-text">
View Add new menu: Review Us
// Reviews Menu Actions
function register_review_menu() {
register_nav_menu('review-menu',__('Review Us Menu'));
}
add_action('init', 'register_review_menu');
// Use a hook on where you want that menu to appear. Depending on your theme or framework this section will be different.
// I include my menu at the bottom of the header section
View review-us-html
<ul id="rating">
<li class="star">
<a href="#feedbackform" alt="We could have done better" title="We could have done better">★</a>
</li>
<li class="star">
<a href="#feedbackform" alt="We could have done better" title="We could have done better">★</a>
</li>
<li class="star">
<a href="#feedbackform" alt="We could have done better" title="We could have done better">★</a>
</li>
View review-us-css
/**
*
* Reviews Us Example
*
*/
#rating::before {
content: 'RATE US';
margin-top: 15px;
margin-right: 15px;
@netmagik
netmagik / enable HSTS
Last active May 22, 2017
Enable HSTS - HTTP Strict Transport Security in .htaccess
View enable HSTS
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
</IfModule>
View Disable Emoji in WordPress
/**
* Disable the emoji's
*/
function disable_emojis() {
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' );
View Async JS deferred by Autoptimize plugin
// Add Async to JS deferred by Autoptimize plugin
add_filter('autoptimize_filter_js_defer','my_ao_override_defer',10,1);
function my_ao_override_defer($defer) {
return $defer."async ";
}
View Remove query strings from static resources
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
View gzip in .htaccess
<IfModule deflate_module>
<IfModule filter_module>
AddOutputFilterByType DEFLATE text/plain text/html
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE font/otf font/opentype application/font-otf application/x-font-otf
AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
</IfModule>
</IfModule>
@netmagik
netmagik / images.php
Created Nov 4, 2015 — forked from phpbits/images.php
Automatically replace original uploaded image with large image size
View images.php
<?php
/*
* Remove Original Uploaded images
* retain large size image
*/
add_filter('wp_generate_attachment_metadata','phpbits_replace_uploaded_image');
function phpbits_replace_uploaded_image($image_data) {
// if there is no large image : return
if (!isset($image_data['sizes']['large'])) return $image_data;
You can’t perform that action at this time.