Skip to content

Instantly share code, notes, and snippets.

@voneff
voneff / voneff-iubenda-style.css
Last active Apr 6, 2020
Adapting the style of the Private Policy text embed by iubenda to the Uku theme by Elmastudio
View voneff-iubenda-style.css
#iubenda_policy {
font-family: 'Noticia Text',serif!important;
font-size: 19px!important;
font-size: 1.1875rem!important;
font-weight: normal!important;
line-height: 1.6!important;
color: #1a1a1a!important;
-webkit-font-smoothing: antialiased!important;
-moz-osx-font-smoothing: grayscale!important;
}
@voneff
voneff / functions.php
Last active Jun 25, 2019
WordPress Dashboard: moving top level menu items added by plugins to the 'Settings' menu (example: CoBlocks)
View functions.php
<?php
/* Add the code below to functions.php of your child theme or your custom functionality plugin – without the php tag above – and remove this line */
/* Moving the CoBlocks menu item under the 'Settings' menu */
/* @link: https://codex.wordpress.org/Function_Reference/remove_menu_page */
/* @link: https://gist.github.com/voneff/d0a1bf5a77b3f45b7bdeaa52996fa623 */
function voneff_move_coblocks_settings() {
View wider_gutenberg_sidebar.php
// *******************************
// Make Gutenberg Sidebar Wider / Fluid
// -------------------------------
function wider_gutenberg_settings_sidebar() { ?>
<style>
@media (min-width: 1080px) {
#wpwrap .edit-post-layout.is-sidebar-opened .components-notice-list {
right: 26vw !important;
}
#wpwrap .edit-post-layout.is-sidebar-opened .edit-post-plugin-sidebar__sidebar-layout,
@voneff
voneff / wp-config.php
Last active Oct 10, 2018
WordPress: custom security measures for wp-config.php
View wp-config.php
# Custom Security Measures by @voneff
#
# Sources:
# @link https://gist.github.com/voneff/f66128aaacd350294e8a
# @link https://premium.wpmudev.org/blog/keeping-wordpress-secure-the-ultimate-guide
# @link https://kinsta.com/blog/wp-config-php/
# @link https://kittpress.com/wordpress-sicherheit-2-erste-konfiguration/
#
# Turn Off PHP Error Reporting:
@voneff
voneff / functions.php
Last active Oct 10, 2018
WordPress: security measures for functions.php
View functions.php
<?php
/*
* Disable version information from being displayed in the header or RSS feed
*
* Sources:
* http://torquemag.io/2016/06/keep-your-wordpress-site-safe-with-these-four-tips/
*/
function disable_version_info() {
@voneff
voneff / functions.php
Last active Oct 10, 2018
WordPress: disabling Emojis and keeping emoticons as text
View functions.php
<?php
/**
* Disable WordPress emojis
* Source: https://kinsta.com/knowledgebase/disable-emojis-wordpress/#disable-emojis-code
*/
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' );
@voneff
voneff / functions.php
Created May 23, 2018
WordPress: Disable IP collection through WordPress comments
View functions.php
<?php
/**
* Remove IP collection in WordPress comments
* Source: http://www.wpbeginner.com/wp-tutorials/how-to-stop-storing-ip-address-in-wordpress-comments/
*/
function wpb_remove_commentsip( $comment_author_ip ) {
return '';
}
add_filter( 'pre_comment_user_ip', 'wpb_remove_commentsip' );
@voneff
voneff / functions.php
Last active Oct 10, 2018
WordPress: unregister custom post type registered by plugin "Essential Grid"
View functions.php
<?php
/*
* Use this funtion to delete the custom post type registered by the plugin "Essential Grid"
* Alternative method to the one proposed by plugin authors:
* https://www.themepunch.com/faq/hide-ess-grid-posts-custom-post-type-from-wp-main-menu/
*
* Usage for other CPT: Replace 'essential_grid' with the slug of the custom post type
*
* Sources:
* https://gist.github.com/johnkolbert/769160
@voneff
voneff / style.css
Created Sep 21, 2018
iubenda: Styling the Privacy Policy
View style.css
/*-----------------------------------------------------------------------------------*/
/* CSS modification for iubenda Privacy Policy
/*-----------------------------------------------------------------------------------*/
#iubenda_policy {
font-family: 'SupriaSans',Helvetica,Arial,FreeSans,sans-serif!important;
}
#iubenda_policy h1 {
display: none!important;
}
@voneff
voneff / functions.php
Created Aug 5, 2018
WordPress: Allow SVG uploads
View functions.php
<?php
/* Allow upload of SVG files */
/* Source: https://blog.kulturbanause.de/2013/05/svg-dateien-in-die-wordpress-mediathek-hochladen/ */
function voneff_svg ( $svg_mime ){
$svg_mime['svg'] = 'image/svg+xml';
return $svg_mime;
}