Skip to content

Instantly share code, notes, and snippets.

View samikeijonen's full-sized avatar
🏠
Working from home

Sami Keijonen samikeijonen

🏠
Working from home
View GitHub Profile
@samikeijonen
samikeijonen / related-widget.php
Created January 20, 2015 16:00
Get post from same taxonomy.
@samikeijonen
samikeijonen / content.php
Created July 20, 2015 13:34
Example content.php using the excerpt
<div class="entry-summary" <?php hybrid_attr( 'entry-summary' ); ?>>
<?php
the_excerpt();
?>
</div><!-- .entry-summary -->
@samikeijonen
samikeijonen / custom-home-link.php
Created July 27, 2015 09:36
Add home icon (minus the text) to the navigation using Custom link
@samikeijonen
samikeijonen / enable-lightbox.php
Last active August 29, 2015 14:27
Enable Simple Lightbox in feature image when on singular page.
/**
* Enable lightbox in feature image when on singular page.
*
* @see: https://wordpress.org/support/topic/help-activating-slb-in-my-theme?replies=14
*/
function toivo_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
@samikeijonen
samikeijonen / gist:3048693
Created July 4, 2012 18:12
Filter Origin byline
add_filter( 'origin_byline', 'my_byline' );
function my_byline( $byline ) {
$byline = '<div class="byline">' . __( 'Article by [entry-author] - [entry-comments-link]', 'origin' ) . '</div>';
return $byline;
}
@samikeijonen
samikeijonen / page-template-bloghatchpro.php
Created July 25, 2012 19:15
Hatch Pro Blog Template
<?php
/**
* Template Name: blog
*
* A custom page template for displaying blog archives.
*
* @package Hatch Pro
* @subpackage Template
*/
@samikeijonen
samikeijonen / remove between categories
Created August 8, 2012 12:29
Oxygen: filter byline remove , between categories
/* Filter bylines. */
add_filter( 'oxygen_byline', 'my_byline' );
add_filter( 'oxygen_byline_category', 'my_byline_category' );
function my_byline( $byline ) {
$byline = '<div class="byline">' . __( '[entry-published] &middot; by [entry-author] &middot; in [entry-terms taxonomy="category" separator=" "] [entry-edit-link before=" &middot; "]', 'oxygen' ) . '</div>' ;
return $byline;
@samikeijonen
samikeijonen / gist:3798996
Created September 28, 2012 10:09
Florence Child functions.php with HTML5 shiv
<?php
/**
* @package Florence Child
* @subpackage Functions
* @version 0.1
* @author Galin Simeonov
* @link http://devpress.com
* @license http://www.gnu.org/licenses/gpl-2.0.html
*/
<!DOCTYPE html>
<html>
<head>
<title>Lomake</title>
</head>
<body>
<h1>Lomake</h1>
@samikeijonen
samikeijonen / gist:3986527
Created October 31, 2012 11:21
Tehtävä 1
<!DOCTYPE html>
<html>
<head>
<title>Keskiarvo</title>
</head>
<body>
<h1>Keskiarvo</h1>