Skip to content

Instantly share code, notes, and snippets.

@bugsysop
bugsysop / .gitignore
Created August 20, 2011 16:26 — forked from Fil/.gitignore
Outil pour créer une copie locale statique de "mes" seens
# ma config
seen-local-config.php
# stockage de mon backup xml
tmp/
# mes fichiers exportes
seen/
# mac os x
@bugsysop
bugsysop / gist:3180399
Created July 26, 2012 05:19 — forked from samikeijonen/gist:3048693
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;
}
<?php
/**
* Template Name: blog
*
* A custom page template for displaying blog archives.
*
* @package Hatch Pro
* @subpackage Template
*/
@bugsysop
bugsysop / embed-gist.php
Created July 30, 2012 08:25 — forked from roborourke/embed-gist.php
Adds autoembedding of gist urls in WordPress
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@bugsysop
bugsysop / gtoc.php
Created August 5, 2012 05:38 — forked from turtlepod/gtoc.php
Genbu Table Of Content Shortcode
<?php
/*
* Genbu Table Of Content Shortcode
* use [gtoc] to generate shortcode
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Based on (credit) :
* WP TOC by Brendon Boshell http://infinity-infinity.com/
@bugsysop
bugsysop / sticky-custom-post-types.php
Created August 23, 2012 21:43 — forked from Viper007Bond/sticky-custom-post-types.php
Bug fixes and coding standards for Sticky Custom Post Types
<?php
/*
Plugin Name: Sticky Custom Post Types
Plugin URI: http://superann.com/sticky-custom-post-types/
Description: Enables support for sticky custom post types. Set options in Settings &rarr; Reading.
Version: 1.2.2
Author: Ann Oyama
Author URI: http://superann.com
License: GPL2
@bugsysop
bugsysop / gist:3849142
Created October 7, 2012 18:22 — forked from Viper007Bond/gist:3832072
WordPress.com's watermarker plugin
<?php
/*
* Plugin Name: WordPress.com Watermark Image Uploads
* Description: Applies a watermark image of your choosing to all uploaded images.
* Author: Alex Mills
* Author URI: http://automattic.com/
*/
class WPcom_Watermark_Uploads {
.container-fluid {
max-width: 980px;
margin: 0 auto;
}
@bugsysop
bugsysop / custom-field.php
Last active December 17, 2015 18:29 — forked from daviddarnes/Anchor Custom Article Field
For outputting a custom field marked with 'image' in the database within an article.
<?php
/*
This is to show a custom field from an article.
It will need to be created in the metadata section before it can be used in the post edit area.
In this case the custom field will need to be called 'image' and be set as an image custom field in the dropdown for type.
*/
$image = article_custom_field('image'); // Applying a variable to the custom field, so it can be reused with ease
if ( !empty($image) ) : // Check if the field is empty, if it is the process stops here
?>
<figure>
@bugsysop
bugsysop / custom-background.php
Last active December 17, 2015 18:29 — forked from daviddarnes/Anchor Custom Background Image Field
Custom Background Image field for Anchor CMS themes.
<div class="bg-header"
<?php
/*
This is to show a custom field from an article.
It will need to be created in the metadata section before it can be used in the post edit area.
In this case the custom field will need to be called 'image' and be set as an image custom field in the dropdown for type.
*/
$image = article_custom_field('image'); // Applying a variable to the custom field, so it can be reused with ease
if ( !empty($image) ) : // Check if the field is empty, if it is the process stops here