Skip to content

Instantly share code, notes, and snippets.

View iamkingsleyf's full-sized avatar

Kingsley Felix iamkingsleyf

View GitHub Profile
<?php
// register the custom post type widget area
genesis_register_sidebar( array(
'id' => 'cpt-archive-sidebar',
'name' => __( 'Custom Post Type Sidebar' ),
'description' => __( 'Display this sidebar on your custom post type archive page.' ),
) );
<?php
/**
* Plugin Name: Cache Post Thumbnails
* Description: Prime the post thumbnails cache for individual loops.
* Version: 1.0.0
* Author: Brady Vercher
* Author URI: http://www.blazersix.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
<?php
//do not copy the opening php tag above
/**
* Changing the AuthorBox in WordPress
*
* @package Changing the AuthorBox in WordPress
* @author Neil Gee
* @link http://coolestguidesontheplanet.com/author-box-genesis/
# Create a filter called 'apache-wp-login'
[Definition]
failregex = <HOST>.*] "POST /wp-login.php HTTP/.*" 200
ignoreregex =
[INCLUDES]
before = apache-common.conf
# Create a jail
[wp-login]
@iamkingsleyf
iamkingsleyf / my.cnf-2GB
Last active August 29, 2015 14:16 — forked from sr75/my.cnf
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
<?php
//checking if the function exist to avoid conflicts
if (function_exists('get_rocket_cdn_url')){
?>
<img class="logo" src="<?php echo get_rocket_cdn_url (get_option('logo_url') );?>"/>
<?php } ?>
@iamkingsleyf
iamkingsleyf / custom_posttype_glance.php
Last active August 29, 2015 14:27 — forked from feryardiant/custom_posttype_glance.php
Adding Custom post type counts in 'Right now' Dashboard widget in Wordpress 3.8 or above
<?php
/**
* Adding Custom post type counts in 'Right now' Dashboard widget.
* Acording this changes :
* - https://core.trac.wordpress.org/ticket/26571
* - https://core.trac.wordpress.org/ticket/26495
* now you can't use 'right_now_*' action API to show your custom post type count from your Dashboard.
* But if you running WP 3.8 or above, you can use 'dashboard_glance_items' instead.
*
* @package Wordpress
@iamkingsleyf
iamkingsleyf / gist:2a1c2be769c0af1e0faf
Last active August 29, 2015 14:27 — forked from evansolomon/gist:2274120
nginx WordPress multisite config
server {
listen 80 default_server;
server_name domain.com *.domain.com;
root /srv/www/domain.com/public;
access_log /srv/www/domain.com/log/access.log;
error_log /srv/www/domain.com/log/error.log;
location / {
index index.php;
@iamkingsleyf
iamkingsleyf / nginx-latest.sh
Last active August 29, 2015 14:27 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list