Skip to content

Instantly share code, notes, and snippets.

View ckaklamanos's full-sized avatar

Haris Kaklamanos ckaklamanos

View GitHub Profile
@ckaklamanos
ckaklamanos / gist:02865febd2fca023dcc0
Last active October 1, 2015 13:57
Git: Make current commit the only commit in Git repo (usually after clone)
git checkout --orphan temp #temp is the name of the temporary branch
git add -A # Add all files and commit them
git commit -m "Initial commit"
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master
@ckaklamanos
ckaklamanos / gist:c9cb54ed567edc154d43
Created October 1, 2015 13:57
Git - Beautiful git log
git log --oneline --decorate --all --graph
@ckaklamanos
ckaklamanos / gist:2e67e5df9d8a0007d14f
Created October 1, 2015 13:59
Git: git add with reviewing changes
git add -p
@ckaklamanos
ckaklamanos / .gitignore
Created October 2, 2015 06:19 — forked from salcode/.gitignore
WordPress .gitignore - this is my preferred gitignore file when working with WordPress. It ignores almost all files by default.
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20150227
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@ckaklamanos
ckaklamanos / gist:a9d6a7d8caa655d5ac8c
Last active October 8, 2015 12:08
Wordpress Custom Post Type: Add Order column in admin list page
add_filter('manage_$post_type_posts_columns', 'set_$post_type_columns');
function set_$post_type_columns($columns) {
$columns['order'] = 'Order';
return $columns;
}
add_action('manage_$post_type_posts_custom_column', 'set_$post_type_show_columns');
function set_$post_type_show_columns($name) {
global $post;
switch ($name) {
case 'order':
@ckaklamanos
ckaklamanos / gist:448984aadd5897e2a8fc
Created October 11, 2015 18:23
CS Cart .gitignore for Addon development
# -----------------------------------------------------------------
# .gitignore for CS Cart theme and addon development
#
# By default all files are ignored. You'll need to whitelist
# any addons, folders, files you want to include in the repo.
#
# To ignore uncommitted changes in a file that is already tracked, use
# git update-index --assume-unchanged
#
# To stop tracking a file that is currently tracked, use
@ckaklamanos
ckaklamanos / gist:2bcee861864b77c72477
Last active September 5, 2017 08:04
Wordpress white label / custom branding
// Put this in child theme's function.php
// Upload the logo to /imahes folder of child theme
// Logo must be 80 x 80 or apply custom CSS
// custom admin login logo
function custom_login_logo() {
echo '<style type="text/css">
h1 a {
background-image: url(wp-content/themes/'.get_stylesheet().'/images/logo.png) !important;
width:186px!important;
background-size: 186px 65px!important;
@ckaklamanos
ckaklamanos / gist:5b9c25311bb9f12f0d29
Last active October 17, 2015 08:58
Wordpress Better page management
// Add excerpt to pages
add_action( 'init', 'custom_add_excerpts_to_pages' );
function custom_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
/*
Add Page Order column to Pages List Admin page
*/
add_filter('manage_pages_columns', 'custom_columns');
@ckaklamanos
ckaklamanos / gist:470f3fdc166b11db1323
Last active November 11, 2015 10:34
Wordpress wp-config custom
define('AUTOSAVE_INTERVAL', 300 ); // seconds
define('WP_POST_REVISIONS', false );
define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' );
define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' );
define('DISALLOW_FILE_EDIT', TRUE);
@ckaklamanos
ckaklamanos / customize_wp_login_page.php
Last active January 25, 2020 12:46
Customize wp-login.php page
class Customize_WP_Login_Page
{
public function run()
{
add_action('login_enqueue_scripts', array( $this, 'login_enqueue_scripts' ));
add_action('login_title', array( $this, 'replace_login_title' ));
add_action('login_headerurl', array( $this, 'replace_login_headerurl' ));
add_action('login_headertitle', array( $this, 'replace_login_headertitle' ));
}