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
add_shortcode( 'entry-modified', 'krogs_entry_modified_shortcode' ); | |
function krogs_entry_modified_shortcode( $attr ) { | |
$domain = hybrid_get_textdomain(); | |
$attr = shortcode_atts( array( 'before' => '', 'after' => '', 'format' => get_option( 'date_format' ) ), $attr ); | |
$modified = '<abbr class="modified" title="' . sprintf( get_the_modified_time( esc_attr__( 'l, F jS, Y, g:i a', $domain ) ) ) . '">' . sprintf( get_the_modified_time( $attr['format'] ) ) . '</abbr>'; | |
return $attr['before'] . $modified . $attr['after']; | |
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(); ?> | |
<?php // You can do stuff here to display aspects of the posts which meet the criteria of the current loop. ?> | |
<?php endwhile; else: ?> | |
<p><?php _e('The Loop did not find anything.'); ?></p> | |
<?php 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
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
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="info-box"> | |
<?php $krogsquery = new WP_Query( array( | |
'post_type' => 'post', | |
'posts_per_page' => 3 | |
)); ?> | |
<h3 class="info-headline">City News</h3> | |
<?php while($krogsquery->have_posts()) : $krogsquery->the_post(); ?> |
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( | |
'post_type' => array ( 'post', 'page' ), | |
'posts_per_page' => 1, | |
'paged' => ( get_query_var('page') ? get_query_var('page') : 1 ) | |
); ?> | |
<?php query_posts( $args ); ?> | |
<?php if ( have_posts() ) : ?> |
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 | |
/* | |
* WordPress Sample function and action | |
* for loading scripts in themes | |
*/ | |
// Let's hook in our function with the javascript files with the wp_enqueue_scripts hook | |
add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' ); |
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 | |
// check for '_my_custom_field' meta key on pages and page parents and add a body class if meta value equals 'some-value' | |
add_filter('body_class','krogs_custom_field_body_class'); | |
function krogs_custom_field_body_class( $classes ) { | |
global $post; |
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 | |
/** | |
* Add function to widgets_init that'll load our widget. | |
* @since 0.1 | |
*/ | |
add_action( 'widgets_init', 'latest_load_widgets' ); | |
/** | |
* Register our widget. | |
* 'Latest_Tweet_Widget' is the widget class used below. |
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 | |
add_filter( 'gettext', 'krogs_event_change_venue_name', 20, 3 ); | |
/** | |
* Change comment form default field names. | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function krogs_event_change_venue_name( $translated_text, $text, $domain ) { |
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 | |
/** | |
* Displays a list of terms for a specific taxonomy. | |
* Based on Justin Tadlock's [entry-terms] shortcode | |
* Added attribute to not link to the taxonomy | |
* using wp_get_object_terms() to do so | |
* | |
* @author Brian Krogsgard | |
* | |
* @access public |
OlderNewer