This file contains 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
/** | |
* add class to widget | |
* | |
* | |
*/ | |
function kc_widget_form_extend( $instance, $widget ) { | |
if ( !isset($instance['classes']) ) | |
$instance['classes'] = null; |
This file contains 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
function add_body_class( $classes ) | |
{ | |
global $post; | |
if ( isset( $post ) ) { | |
$classes[] = $post->post_type . '-' . $post->post_name; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'add_body_class' ); |
This file contains 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> |
This file contains 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 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 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 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 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 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; ?> |
OlderNewer