This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************* Display the page or post slug *****************/ | |
function get_the_slug( $id=null ){ | |
if( empty($id) ): | |
global $post; | |
if( empty($post) ) | |
return ''; // No global $post var available. | |
$id = $post->ID; | |
endif; | |
$slug = basename( get_permalink($id) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Replace http://stevegrunwell.com with your production site's domain name | |
RewriteRule (.*) http://stevegrunwell.com/wp-content/uploads/$1 | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tabbable"> | |
<ul class="nav nav-tabs"> | |
<li class="active"><a href="#pane1" data-toggle="tab">Tab 1</a></li> | |
<li><a href="#pane2" data-toggle="tab">Tab 2</a></li> | |
<li><a href="#pane3" data-toggle="tab">Tab 3</a></li> | |
<li><a href="#pane4" data-toggle="tab">Tab 4</a></li> | |
</ul> | |
<div class="tab-content"> | |
<div id="pane1" class="tab-pane active"> | |
<h4>The Markup</h4> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<h1><?php the_title(); ?></h1> | |
<?php the_content(); ?> | |
<?php endwhile; else: endif; ?> | |
<?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1> | |
<p><?php the_content(); ?> | |
<?php endwhile; else: endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args=array( | |
'category__not_in' => array(8), | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 5, | |
'caller_get_posts'=> 1 | |
); | |
$my_query = null; | |
$my_query = new WP_Query($args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php $the_query = new WP_Query( 'showposts=3' ); ?> | |
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> | |
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> | |
<li><?php the_excerpt(__('(more…)')); ?></li> | |
<?php if ( has_post_thumbnail() ) { | |
the_post_thumbnail( array(100,100) ); | |
} ?> | |
<?php endwhile;?> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set these dependant on your BB credentials | |
$username = 'username'; | |
$password = 'password'; | |
$branch = 'master'; | |
// FTP Credentials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="featured"> | |
<?php query_posts('posts_per_page=1&cat=1'); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <small><?php the_time('jS F Y'); ?></small> <p><?php the_excerpt(); ?></p> <p> <a href="<?php the_permalink(); ?>">Read More >></a> </p> <?php endwhile; ?> <?php wp_reset_query(); ?> </div><!--featured--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
functions.php | |
function get_excerpt($count){ | |
$permalink = get_permalink($post->ID); | |
$excerpt = get_the_content(); | |
$excerpt = strip_tags($excerpt); | |
$excerpt = substr($excerpt, 0, $count); | |
$excerpt = substr($excerpt, 0, strripos($excerpt, " ")); | |
$excerpt = '<p>'.$excerpt.'... </br><a href="'.$permalink.'">Read more more</a></p>'; | |
return $excerpt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php $the_query = new WP_Query( 'showposts=5' ); ?> | |
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> | |
<span class="latestpostmeta"><?php the_time('M jS, Y') ?> </span></li> | |
<li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li> | |
<li><?php the_excerpt(__('(more…)')); ?></li> | |
<?php the_post_thumbnail(); ?> | |
<?php endwhile;?> | |
</ul> |