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 / placeholders.php
Last active August 26, 2015 08:46
Add placeholders for comment form
<?php
function sonsa_comment_form_fields( $fields ) {
// Required field.
$req = get_option( 'require_name_email' );
// Add placeholder for name.
$fields['author'] = str_replace(
'<input',
@samikeijonen
samikeijonen / theme-updates.php
Last active August 29, 2015 13:55
How to get automatic theme updates using Easy Digital Downloads and Sowtware License add-on.
<?php
/* Set up Licence key for this theme. URL: https://easydigitaldownloads.com/docs/activating-license-keys-in-wp-plugins-and-themes */
/* This is the URL our updater / license checker pings. This should be the URL of the site with EDD installed. */
define( 'MINA_OLEN_SL_STORE_URL', 'http://localhost/foxnet-themes-shop' ); // use your own unique prefix to prevent conflicts
/* The name of your product. This should match the download name in EDD exactly. */
define( 'MINA_OLEN_SL_THEME_NAME', 'Mina olen' ); // use your own unique prefix to prevent conflicts
@samikeijonen
samikeijonen / example-styles.css
Last active August 29, 2015 13:56
Example styles for Mina olen child theme. You can use them as a starting point when creating your custom child theme.
/**
* You can use these styles as a starting point in your child theme styles.
* I have collected all the backgrounds and colors used in Mina olen theme in this file.
*
*/
/* === Backgrounds and colors === */
/* Blockquote. */
@samikeijonen
samikeijonen / custom-walker.php
Created June 2, 2014 18:34
Custom Nav Walker
<?php
class kulkuri_walker extends Walker_Nav_Menu
{
/**
* Start the element output.
*
* @see Walker::start_el()
*
<?php
/**
* Theme licensing for Easy Digital Downloads.
*
* @package Kulkuri
*/
/**
* When using in your own project:
*
@samikeijonen
samikeijonen / grunt-wpcom.js
Last active August 29, 2015 14:02
Example Grunt file for automating WordPress.com version out of same theme
module.exports = function(grunt) {
// Load all tasks
require( 'load-grunt-tasks' )( grunt );
// All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Minify files
@samikeijonen
samikeijonen / content-portfolio_item.php
Created July 4, 2014 13:53
Hopeareanus portfolio item example
<?php
/**
* Content Portfolio Item Template
*
* Template used to show post content when viewing portfolio item.
*
* @package Hopeareunus
* @subpackage Template
* @author Sami Keijonen <sami.keijonen@foxnet.fi>
* @since 0.1.0
@samikeijonen
samikeijonen / stripe-errors.md
Last active August 29, 2015 14:07
Stripe errors

It is failing during the checkSslCert() method in the Stripe_ApiRequestor class.

The message that is getting returned with the error is:

Could not connect to Stripe (https://api.stripe.com).  Please check your internet connection and try again.  If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus. Reason was:

There is supposed to be an error code with it, but there isn’t.

@samikeijonen
samikeijonen / load-style.php
Last active August 29, 2015 14:08
Load styles in parent theme.
<?php
/**
* Enqueue scripts and styles.
*/
function my_theme_scripts() {
/* Enqueue parent theme styles. */
wp_enqueue_style( 'theme-slug-style', trailingslashit( get_template_directory_uri() ) . 'style.css', array(), THEME_VERSION );
/* Enqueue child theme styles. */
@samikeijonen
samikeijonen / front-page.php
Created January 8, 2015 21:48
Mina Olen Front Page template. Posts first.
<?php
/**
* Template Name: Front Page
*
* Show pages info. You can set it under Appearance >> Customize.
*
* @package Mina olen
* @subpackage Template
* @since 1.0.0