__( 'Primary Navigation', 'steira' ),
) );
}
endif; // steira_setup
add_action( 'after_setup_theme', 'steira_setup' );
/**
* fallback for primary navigation
*/
function steira_page_menu() { ?>
'widget_steira_about_text',
'description' => __( 'Text or HTML about your site, in the Steira style', 'steira' ),
)
);
}
function widget( $args, $instance ) {
extract($args);
$title = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
$text = apply_filters( 'widget_steira_about_text', $instance['text'], $instance );
echo $before_widget;
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
'', 'text' => '' ) );
$title = strip_tags($instance['title']);
$text = format_to_edit($instance['text']);
?>
/>
'widget_steira_categories',
'description' => __( 'A grid of categories in the Steira Style', 'steira' ),
)
);
}
function widget($args, $instance) {
extract($args, EXTR_SKIP);
$before_widget ??= null;
$before_title ??= null;
$after_title ??= null;
$after_widget ??= null;
echo $before_widget;
$title = empty($instance['title']) ? __('Post Categories', 'steira') : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
echo '';
wp_list_categories('order=DESC&orderby=count&title_li=&depth=-1');
echo '
';
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['entry_title'] = strip_tags($new_instance['entry_title']);
$instance['comments_title'] = strip_tags($new_instance['comments_title']);
return $instance;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
$title = strip_tags($instance['title']);
?>
'widget_steira_recent_comments',
'description' => __( 'The most recent comments in the Steira style', 'steira' ),
)
);
if ( is_active_widget(false, false, $this->id_base) )
add_action( 'wp_head', array( $this, 'steira_recent_comments_style' ) );
add_action( 'comment_post', array( $this, 'flush_widget_cache' ) );
add_action( 'transition_comment_status', array( $this, 'flush_widget_cache' ) );
}
function steira_recent_comments_style() { ?>
id );
}
function widget( $args, $instance ) {
global $wpdb, $comments, $comment;
$cache = get_transient( 'widget_' . $this->id );
if ( $cache ) {
echo $cache;
return;
}
extract($args, EXTR_SKIP);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments', 'steira') : $instance['title']);
if ( !$number = (int) $instance['number'] )
$number = 5;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;
$comments = $wpdb->get_results("SELECT $wpdb->comments.* FROM $wpdb->comments JOIN $wpdb->posts ON $wpdb->posts.ID = $wpdb->comments.comment_post_ID WHERE comment_approved = '1' AND post_status = 'publish' ORDER BY comment_date_gmt DESC LIMIT 15");
$comments = array_slice( (array) $comments, 0, $number );
ob_start();
?>
id, $cache );
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number'] = (int) $new_instance['number'];
$this->flush_widget_cache();
return $instance;
}
function form( $instance ) {
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
$number = isset($instance['number']) ? absint($instance['number']) : 5;
?>
'widget_steira_recent_posts',
'description' => __( 'The most recent posts on your blog in the Steira style', 'steira' ),
)
);
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
}
function widget($args, $instance) {
$cache = get_transient( 'widget_' . $this->id );
if ( $cache ) {
echo $cache;
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __( 'Recent Posts', 'steira' ) : $instance['title']);
if ( !$number = (int) $instance['number'] )
$number = 10;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;
$r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));
if ($r->have_posts()) :
?>
have_posts()) : $r->the_post(); ?>
-
id, $cache );
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number'] = (int) $new_instance['number'];
$this->flush_widget_cache();
return $instance;
}
function flush_widget_cache() {
delete_transient( 'widget_' . $this->id );
}
function form( $instance ) {
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
if ( !isset($instance['number']) || !$number = (int) $instance['number'] )
$number = 5;
?>
?>
id="li-comment-">
'Sidebar',
'id' => 'sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'init', 'theme_widgets_init' );
/**
* filter the search form to match the Steira style
*/
function steira_search_form() {
$form = '';
return $form;
}
add_filter( 'get_search_form', 'steira_search_form' );
/**
* Enqueue scripts and styles
*/
function steira_scripts() {
wp_enqueue_style( 'steira', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'steira_scripts' );
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @since Steira 1.1
*/
function steira_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'steira' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'steira_wp_title', 10, 2 );
/**
* Load Jetpack compatibility file.
*/
if ( file_exists( get_template_directory() . '/inc/jetpack.php' ) )
require get_template_directory() . '/inc/jetpack.php';
Permalink # %s'), get_comment_author_link()) ?>
comment_approved == '0') : ?>$depth, 'max_depth' => $args['max_depth']))) ?>