Skip to content

Instantly share code, notes, and snippets.

View schikulski's full-sized avatar
🦄
blip-blop

Simen Schikulski schikulski

🦄
blip-blop
View GitHub Profile
@schikulski
schikulski / composer.json
Created June 27, 2013 08:10
Composer template
{
"name": "simenschi/project",
"description": "My Project",
"keywords": ["keyword"],
"require": {
"laravel/framework": "4.0.*"
},
"autoload": {
"classmap": [
"path/to/class"
@schikulski
schikulski / dandelion.yml
Created May 10, 2013 09:51
dandelion.yml
scheme: ftp
host: ftp.example.com
username: example.com
password: password
path: hello/path
exclude: .gitignore dandelion.yml .DS_Store
@schikulski
schikulski / content.php
Created April 13, 2013 09:42
Wordpress: thumbnail
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail('thumbnail');
} ?>
@schikulski
schikulski / widgets.php
Created April 13, 2013 09:27
Wordress: ultra simple widget
/* ==========================================================================
Ultra simple wordpress widget
========================================================================== */
class BlogRoll extends WP_Widget {
public function __construct() {
parent::WP_Widget(false,'DISPLAY NAME','description=DISPLAY DESCRIPTION');
}
@schikulski
schikulski / functions.php
Created April 13, 2013 09:20
Remove default WP widgets
// unregister all widgets
function unregister_default_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Text');
unregister_widget('WP_Widget_Categories');
@schikulski
schikulski / wp_featured_and_twocolumnwrap.php
Last active December 15, 2015 14:39
Wordpress: First as featured, then two column posts
@schikulski
schikulski / wp_twocolumnwrap.php
Last active December 15, 2015 14:39
Wordpress: Two column wrap
<?php while( have_posts() ) : the_post(); //start of the loop ?>
<?php if( $wp_query->current_post%2 == 0 ) echo "\n".'<div class="twocolumnpostswrap">'."\n"; ?>
<?php // do post stuff here ?>
<?php if( $wp_query->current_post%2 == 1 || $wp_query->current_post == $wp_query->post_count-1 ) echo '</div> <!--/.twocolumnpostswrap-->'."\n"; ?>
<?php endwhile; //end of the loop ?>