Skip to content

Instantly share code, notes, and snippets.

View ekandreas's full-sized avatar

Andreas Ek ekandreas

View GitHub Profile
<?php
class Newsletter_Banner_Page_Type extends Papi_Page_Type
{
public function page_type()
{
return [
'post_type' => 'skpnewsletter',
'name' => 'Banner för nyhetsbrev',
@ekandreas
ekandreas / papi.php
Last active July 8, 2017 02:14
papi page types in theme
<?php
namespace ekandreas;
class Papi
{
function __construct()
{
add_filter( 'papi/settings/directories', function ( $directories ) {
$directories[] = dirname(__FILE__) . '/page-types';
return $directories;
@ekandreas
ekandreas / options-general.php
Last active November 30, 2015 16:12
Options General Type for theme with Papi
<?php
/**
* Options General Type for theme with Papi
* Andreas Ek, 2015-11-30
*/
class Options_General_Type extends Papi_Option_Type
{
/**
* Where to register the option page to show
@ekandreas
ekandreas / deploy.php
Last active April 26, 2021 22:04
Deploy example PHP Deployer
<?php
/*** step 1 ***/
date_default_timezone_set('Europe/Stockholm');
/*** step 2 ***/
include_once 'vendor/deployer/deployer/recipe/common.php';
/*** step 3 ***/
server( 'production', 'andreasek.se', 22 )
->env('deploy_path','/mnt/persist/www/aekab.se')
composer require deployer/deployer
dep deploy production
composer require ekandreas/bladerunner
wp-content
└── themes
└── your_theme
├── style.css <- standard theme style.css, mandatory
├── index.php <- standard index theme, mandatory
├── single.php <- standard index theme, mandatory
└── views <- folder for Blade view templates
├── index.blade.php <- the index page template
├── single.blade.php <- the single page template
/*
Theme Name: Minimal Bladerunner Theme
*/
<?php
bladerunner('views.index');