Skip to content

Instantly share code, notes, and snippets.

@aristath
Created May 1, 2013 17:23
Show Gist options
  • Save aristath/5496734 to your computer and use it in GitHub Desktop.
Save aristath/5496734 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Shoestrap Custom Templates
Plugin URI: http://shoestrap.org
Description: This plugin replaces the default templates with our custom ones using the hooks provided by the <a href="http://shoestrap.org/downloads/shoestrap">Shoestrap</a> theme
Version: 1.00
Author: Aristeides Stathopoulos
Author URI: http://aristeides.com
*/
/*
* Our custom template for single posts
*/
function my_custom_single_content_template() { ?>
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php get_template_part( 'templates/entry-meta' ); ?>
</header>
<div class="entry-content">
<?php do_action( 'shoestrap_before_the_content' ); ?>
<?php the_content(); ?>
<?php do_action( 'shoestrap_after_the_content' ); ?>
</div>
<footer>
<?php wp_link_pages( array( 'before' => '<nav id="page-nav"><p>' . __( 'Pages:', 'shoestrap' ), 'after' => '</p></nav>' ) ); ?>
<?php the_tags( '<i class="icon-tags"></i>',', ','' ); ?>
</footer>
<?php comments_template( '/templates/comments.php' ); ?>
</article>
<?php endwhile; ?>
<?php
}
/*
* replace the default post template with our custom template
*/
function replace_my_custom_single_product_template() {
add_action( 'shoestrap_single_content', 'my_custom_single_content_template', 10 );
remove_action( 'shoestrap_single_content', 'shoestrap_single_content_template', 10 );
}
add_action( 'shoestrap_single_content', 'replace_my_custom_single_product_template', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment