Skip to content

Instantly share code, notes, and snippets.

@gorobey
gorobey / fix-wordpress-permissions.sh
Created September 15, 2022 09:50 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@gorobey
gorobey / wordpress_disable_plugin.php
Created September 15, 2022 09:46 — forked from joffff/wordpress_disable_plugin.php
Disable WordPress plugin on specific page
<?php
add_filter( 'option_active_plugins', 'disable_plugins' );
function disable_plugins($plugins){
$key = array_search( 'wordpress-seo/wp-seo.php' , $plugins ); //Plugin path within /wp-content/plugins/
if ( false !== $key ) unset( $plugins[$key] );
return $plugins;
@gorobey
gorobey / buzz-player.js
Created August 30, 2022 18:34 — forked from vvasilev-/buzz-player.js
mini audio player with Buzz.js
// constructor
var Player = function(source){
// cache vars
this.sound = new buzz.sound(source.split('.')[0], { formats: ['ogg', 'mp3'], volume: 100 });
this.$playBtn = $('.ui-page-active .jp-play');
this.$pauseBtn = $('.ui-page-active .jp-pause');
this.$rewindBtn = $('.ui-page-active .rewind');
this.$duration = $('.ui-page-active .jp-duration');
this.$seekBar = $('.ui-page-active .jp-seek-bar');
@gorobey
gorobey / functions.php
Created August 23, 2022 17:24 — forked from abecoffman/functions.php
Adds Facebook SDK to Wordpress
<?php
function facebook_sdk_init() {
wp_enqueue_script('jquery');
// instruction to only load if it is not the admin area
if ( !is_admin() ) {
// register and load the facebook sdk
wp_register_script( 'facebook-sdk',
'http://connect.facebook.net/en_US/all.js',
array(), '', TRUE);
<?php
// Change the footer text in Genesis with a back up if blank
add_filter('genesis_footer_creds_text', 'genesischild_footer_text');
function genesischild_footer_text() {
if( get_theme_mod( 'footer_text_block') != "" ) {
echo get_theme_mod( 'footer_text_block');
}
else{
@gorobey
gorobey / wp-meta-description.php
Created June 2, 2021 09:55 — forked from zgordon/wp-meta-description.php
Add Meta Description to WordPress Theme
function custom_get_excerpt($post_id) {
$temp = $post;
$post = get_post( $post_id );
setup_postdata( $post );
$excerpt = esc_attr(strip_tags(get_the_excerpt()));
wp_reset_postdata();
$post = $temp;
/*woocommerce pagination*/
.woocommerce nav.woocommerce-pagination{}
.woocommerce nav.woocommerce-pagination ul.page-numbers{}
.woocommerce nav.woocommerce-pagination ul li{}
.woocommerce nav.woocommerce-pagination ul li a{}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover{}
.woocommerce nav.woocommerce-pagination ul li a.prev,
.woocommerce nav.woocommerce-pagination ul li a.next{}
/**
* My Account
*/
.woocommerce-account .woocommerce-MyAccount-navigation {
width: 20%;
}
.woocommerce-account .woocommerce-MyAccount-content {
display: inline-block;
@gorobey
gorobey / divi-breakpoints.css
Created April 13, 2021 11:06 — forked from d8m18n/divi-breakpoints.css
Divi theme breakpoints
/**
* Divi theme breakpoints - thanks to https://divibooster.com/css-media-queries-for-the-divi-theme/
*/
/* Large screens (1405px upwards) */
@media only screen and ( min-width: 1405px ) {
/* your css goes here */
}
/* Laptops and desktops (1100-1405px) */
@gorobey
gorobey / fail2ban-allstatus.sh
Created April 12, 2021 21:35 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done