Skip to content

Instantly share code, notes, and snippets.

@aahan
aahan / WordPress Custom Sender Name & Email Address.php
Last active October 14, 2016 08:11
Different solutions that've found to replace WordPress' default admin email address and name. Should be added to your theme's functions.php file.
<?php
/*
* DESCRIPTION: All WordPress email notifications are sent from
* wordpress@yourdomain.com with the sender's name as "WordPress".
* Any one of these functions should help you change that.
*
* Relevant WordPress core file is /wp-includes/pluggable.php
*/
@aahan
aahan / MySQL & MariaDB Config.md
Last active December 12, 2015 09:49
Configuring MySQL/MariaDB - Explanation of important variables.
@aahan
aahan / Highlight First Post.php
Last active December 13, 2015 17:58
Adds a custom class for the first post, on the first page of index and archive pages.
<?php
if( $wp_query->current_post == 0 && !is_paged() ) {
post_class('first-post');
} else {
post_class();
}
?>
@aahan
aahan / WordPress to Jekyll Checklist.md
Last active December 15, 2015 04:39
Considering a move from WordPress to a database-free static site using Jekyll/Octopress? Here are some of the important things you need to make sure are there.
@aahan
aahan / Style Guide.md
Last active December 15, 2015 06:49
List of style guides for my favorite languages.
@aahan
aahan / jekyll-octopress-setup.md
Last active December 15, 2015 07:59
Setting up my Jekyll/Octopress site on my Ubuntu 12.04 LTS virtual server.

Initial setup

Update System

sudo apt-get update && sudo apt-get upgrade

Install Git

sudo apt-get install git
@aahan
aahan / README.md
Last active December 15, 2015 08:09
Jekyll RSS feed template based on WordPress' RSS feed template.

feed.xml

---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"

Pre-requisites

Server running Debian/Ubuntu Server with Nginx webserver set up.

Initial setup

Update System

sudo apt-get update && sudo apt-get upgrade
/* Delete revisions */
DELETE FROM wp_posts WHERE post_type = "revision";
/* Only use this if you no longer care about any of your current revisions! */
/* Delete trashed posts */
DELETE FROM wp_posts WHERE post_type = "trash";
/* Delete Unapproved comments */
DELETE FROM wp_comments WHERE comment_approved = "0";
/* Only use this if you no longer care about the current queue of unapproved comments! */