Skip to content

Instantly share code, notes, and snippets.

@bugsysop
bugsysop / timeline.php
Created September 27, 2012 20:53
Verite Timeline JSON controller for JSON API WordPress Plugin
<?php
/*
JSON Controller for JSON API WordPress Plugin to return posts in Timeline format for Verite Timeline WordPress Plugin
Author: Miguel Peixe
Reference: http://wordpress.org/support/topic/plugin-verite-timeline-getting-wordpress-posts-into-timeline
@bugsysop
bugsysop / index.html
Created September 28, 2012 21:16
CSS3 hole with tooltip
<!--
Source : http://codepen.io/01miru/pen/kjsag
-->
<div class="light2"></div>
<div class="container">
<ul>
<li>
<div class="element">
<div class="tooltip">
@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 {
@bugsysop
bugsysop / underscore.sh
Created October 20, 2012 21:38
Getting Started With the _s Theme
#!/bin/sh
# Joel Kirchartz
# http://themeshaper.com/2012/02/21/getting-started-with-the-underscores-theme/comment-page-1/#comment-73697
printf "What do you want to name your _s theme? "
read -e NAME
cp -rf _s $NAME
find ./$NAME/ -type f | xargs perl -pi -e "s/'_s'/'$NAME'/g"
find ./$NAME/ -type f | xargs perl -pi -e "s/_s_/$NAME_/g"
.container-fluid {
max-width: 980px;
margin: 0 auto;
}
@bugsysop
bugsysop / wordpress_install.sh
Created May 20, 2013 03:43
Script for installing the latest version of WordPress plus a number of useful plugins.
#!/bin/sh
#
# Instant Wordpress!
# ------------------
# Script for installing the latest version of WordPress plus a number of useful plugins.
# Source : https://github.com/snaptortoise/wordpress-quick-install
#
#
# Latest version of WP
@bugsysop
bugsysop / install.sh
Created May 20, 2013 03:51
Install script for quick static site
#!/bin/bash
#
# Install script for quick static site
# Source : https://github.com/stevedev/html_template
#
curl -L http://github.com/stevedev/html_template/zipball/master > stevedev-html_template.zip
unzip stevedev-html_template.zip
rm -fr stevedev-html_template.zip
mv stevedev-html_template* newsite
@bugsysop
bugsysop / anchor-breadcrumbs.php
Created May 25, 2013 22:45
Create a breadcrumbs for Anchor CMS. Add this function in the theme functions.php file.
/*
Usage:
<?php foreach(mytheme_breadcrumbs() as $uri => $name): ?>
<a href="<?php echo $uri; ?>"><?php echo $name; ?></a>
<?php endforeach; ?>
*/
@bugsysop
bugsysop / page-selected-cats.php
Created May 25, 2013 22:56
Anchor CMS. Display only selected categories on a page. Code to add in the custom page template.
<?php
// allowCat contains all catergory ID that you want on your page
$allowCat = array(2,3,4,5,6);
function article_category_id() {
if($category = Registry::prop('article', 'category')) {
$categories = Registry::get('all_categories');
return $categories[$category]->id;
}
@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>