Skip to content

Instantly share code, notes, and snippets.

View Temmyhlee's full-sized avatar

Temmyhlee Temmyhlee

View GitHub Profile
@Temmyhlee
Temmyhlee / gist:e71b132f33276c18723c696d0bb26c00
Created May 28, 2018 07:18 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
//* Add new widget Between Posts Area
genesis_register_sidebar( array(
'id' => 'between-posts-area',
'name' => __( 'Between Posts Area', 'basicwp-theme' ),
'description' => __( 'This widget show between and after few posts.', 'basicwp-theme' ),
) );
//* Add widget area between and after 3 posts
add_action( 'genesis_after_entry', 'basicwptheme_between_posts_area' );
@Temmyhlee
Temmyhlee / functions.php
Created August 2, 2016 18:44 — forked from About2git/functions.php
Random ad after every second post in Genesis.
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_after_entry', 'google_ad' );
/**
* Insert one random ad after every second post.
*
* Scope: Posts page and all category archives.
*
* @author Sridhar Katakam
@Temmyhlee
Temmyhlee / functions.php
Created August 2, 2016 08:02 — forked from srikat/functions.php
Entry Header, First Paragraph, Featured Image Above Content (from second para) and Sidebar on single Posts in Genesis. https://sridharkatakam.com/entry-header-first-paragraph-featured-image-above-the-remaining-content-and-sidebar-on-single-posts-in-genesis/
// Register a custom image size for featured images on single Posts
add_image_size( 'post-single', 1200, 300, true );
// Create a shortcode that outputs the URL of author page for the entry author outside the loop
add_shortcode( 'post_author_posts_link_outside_loop', 'sk_post_author_posts_link_shortcode' );
/**
* Produces the author of the post (link to author archive).
*
* Supported shortcode attributes are:
* after (output after link, default is empty string),
<?php
/**
* Archive Grid Divider
*
*/
function be_grid_divider() {
// only run on blog home and archives
if( !( is_home() || is_archive() ) )
return;
<?php
/**
* Remove Post Info and Meta from Teasers
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/remove-post-info-meta-teasers/
*/
function be_remove_info_from_teasers() {
<?php
/**
* Remove items from grid posts
*
*/
function be_grid_post_customization() {
// make sure we're on a grid post
if( !in_array( 'one-half', get_post_class() ) )
return;
@Temmyhlee
Temmyhlee / functions.php
Last active July 30, 2016 22:24 — forked from billerickson/functions.php
Use archive.php for home, archives and search
<?php
add_filter( 'template_include', 'be_template_redirect' );
/**
* Template Redirect
* Use archive.php for blog (home.php), archives, and search
*
* @author Bill Erickson
* @link http://www.billerickson.net/code/use-single-template-for-home-archive-and-search/
*