Skip to content

Instantly share code, notes, and snippets.

@timoleinio
timoleinio / maintenance.php
Created July 3, 2013 20:18
WordPress maintenance.php 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
?>
<!DOCTYPE html>
<html>
@timoleinio
timoleinio / wp-config.php
Created July 6, 2013 18:01
Disable file editing in WordPress.
define( 'DISALLOW_FILE_EDIT', true );
@timoleinio
timoleinio / 404.php
Last active December 19, 2015 19:38
<?php
//Ylätunniste
get_header(); ?>
<div class="post hentry">
<!-- Sivua ei löytynyt ilmoitus -->
<h1 class="entry-title">Voi ei! Hakemaasi sivua ei löydy.</h1>
<div class="entry-content">
<p>
Olemme pahoillamme, sillä sivua, jota yritit hakea, ei löytynyt. Osoite on saattanut vanhentua. Voit yrittää käyttää hakua, tai etsiä tietoa alla olevan tiedon perusteella.
</p>
@timoleinio
timoleinio / example
Last active December 20, 2015 03:18
WPSocialite shortcode example
[wpsocialite size="small" url="http://esimerkki.fi" button_override="facebook,twitter-share,twitter-follow,pinterest,linkedin,gplus,stumbleupon"]
@timoleinio
timoleinio / functions.php
Last active December 20, 2015 03:18
WPSocialite PHP example.
<?php
$args = array(
'size' => 'large', //choose which size buttons to display.
'url' => 'http://esimerkki.fi', //use this to override the url that is sent to WPSocialite. Not recommended to use in loop.
'button_override' => 'facebook,twitter-share,twitter-follow,pinterest,linkedin,gplus,stumbleupon' //used to override buttons that are displayed. Add and remove as needed.
);
wpsocialite_markup( $args ); ?>
@timoleinio
timoleinio / wp-config.php
Last active December 21, 2015 17:59
Allow WordPress multisite
define( 'WP_ALLOW_MULTISITE', true );
@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");
?>
@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 / style.css
Last active December 25, 2015 14:59
Facebook like box width
.fb-like-box, .fb-like-box iframe {
width:260px !important
}
<?php
define( 'AUTOMATIC_UPDATER_DISABLED', true );
?>