Skip to content

Instantly share code, notes, and snippets.

@timoleinio
timoleinio / style.css
Created December 8, 2013 11:09
Font Awesome CSS example
i{
color: blue
}
@timoleinio
timoleinio / gist:7855504
Created December 8, 2013 10:07
Last Updated Shortcode
[lastupdate]
@timoleinio
timoleinio / template.php
Last active December 30, 2015 16:29
Last Updated Shortcode to template file
<?php
do_shortcode( [lastupdate format="d.m.Y H:i:s" before="Viimeksi muokattu: "] );
?>
@timoleinio
timoleinio / gist:7855446
Last active December 30, 2015 16:29
Last Updated Shortcode example
[lastupdate format="d.m.Y H:i:s" before="Viimeksi muokattu: "]
@timoleinio
timoleinio / gist:7512361
Created November 17, 2013 11:48
Google Analytics Top Content Widget shortcode example
[google_top_content pageviews=5 number=10 showhome=no time=2628000 timeval=2]
@timoleinio
timoleinio / delete.sql
Created November 7, 2013 17:13
Delete spam comments from WordPress
DELETE FROM [etutunniste]_comments WHERE comment_approved = 'spam';
<?php
define( 'AUTOMATIC_UPDATER_DISABLED', true );
?>
@timoleinio
timoleinio / style.css
Last active December 25, 2015 14:59
Facebook like box width
.fb-like-box, .fb-like-box iframe {
width:260px !important
}
@timoleinio
timoleinio / index.php
Last active December 24, 2015 19:39
Allow WordPress shortcodes in widgets
<?php
/*
Plugin Name: WP-Opas Helper Plugin
Plugin URI: http://wpopas.fi/
Description: Allow shortcodes in widgets.
Version: 1.0
Author: Timo Leiniö
Author URI: http://wpopas.fi/
*/
@timoleinio
timoleinio / db-error.php
Created September 5, 2013 18:08
WordPress database error page example
<?php
// Return http response 503 service unavailable. This is important for SEO too!
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) $protocol = 'HTTP/1.0';
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
header( 'Retry-After: 600' ); // 10 minutes
mail("[email protected]", "Tietokantavirhe tapahtui", "WP-Oppaan tietokannan kanssa on ongelma!", "From: WP-Opas");
?>