Skip to content

Instantly share code, notes, and snippets.

@vanokhin
vanokhin / front-page-hack.md
Last active September 28, 2017 13:33
Handle `Front page displays` option at `Dashboard - Settings - Reading` (WordPress)

Put the following code in functions.php file of your theme:

function THEMESLUG_filter_front_page_template( $template ) {
	return is_home() ? '' : $template;
}

add_filter( 'frontpage_template', 'THEMESLUG_filter_front_page_template' );
@vanokhin
vanokhin / git-commit-push-multiple-repos.sh
Last active May 27, 2017 18:46
Git commit push multiple repos (bash)
#!/bin/bash
# List of repos to create backups for
REPOS=(
"/path/to/repo/1"
"/path/to/repo/2"
)
# Message for auto-commits
@vanokhin
vanokhin / get_template.php
Last active May 27, 2017 18:48
Custom get_template function for plugins (wp)
<?php
/**
* Get template by name
*
* @param string $name Template name without extension
* @param mixed $data Data to pass to the template
*/
function PREFIX_get_template( $name = '', $data = null ) {