id="comment-">
comment_approved == '0' ) : ?>
$depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
id="comment-">
instead of .
*
* @since Starkers HTML5 3.0
*/
function starkers_comment_close() {
echo '';
}
/**
* Adjusts the comment_form() input types for HTML5.
*
* @since Starkers HTML5 3.0
*/
function starkers_fields($fields) {
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => ' ' . ( $req ? '*' : '' ) .
'
',
'email' => ' ' . ( $req ? '*' : '' ) .
'
',
'url' => '' .
'
',
);
return $fields;
}
add_filter('comment_form_default_fields','starkers_fields');
/**
* Register widgetized areas.
*
* @since Starkers HTML5 3.0
*/
function starkers_widgets_init() {
register_sidebar( array(
'name' => __( 'Laurel Widget Area', 'starkers' ),
'id' => 'laurel-widget-area',
'description' => __( 'Laurels in the header - use one image, and make sure it is a transparent PNG no larger than 165px tall by 540px wide.', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Social Media Widget Area', 'starkers' ),
'id' => 'social-widget-area',
'description' => __( 'Social media icons in the navigation bar', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Donate Widget Area', 'starkers' ),
'id' => 'donate-widget-area',
'description' => __( 'The donate section of the page sidebar', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Buy Widget Area', 'starkers' ),
'id' => 'buy-widget-area',
'description' => __( 'The buy DVD and soundtrack sections of the page sidebar', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Blog Widget Area', 'starkers' ),
'id' => 'blog-widget-area',
'description' => __( 'Widgets that appear in the sidebar on blog pages', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Footer Widget Area', 'starkers' ),
'id' => 'footer-widget-area',
'description' => __( 'The footer widget area for logos of supporting organizations', 'starkers' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
}
/** Register sidebars by running starkers_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'starkers_widgets_init' );
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*
* @updated Starkers HTML5 3.2
*/
function starkers_remove_recent_comments_style() {
add_filter( 'show_recent_comments_widget_style', '__return_false' );
}
add_action( 'widgets_init', 'starkers_remove_recent_comments_style' );
if ( ! function_exists( 'starkers_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post—date/time and author.
*
* @since Starkers HTML5 3.0
*/
function starkers_posted_on() {
printf( __( 'Posted on %2$s by %3$s', 'starkers' ),
'meta-prep meta-prep-author',
sprintf( '',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date('Y-m-d'),
get_the_date()
),
sprintf( '%3$s',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'starkers' ), get_the_author() ),
get_the_author()
)
);
}
endif;
if ( ! function_exists( 'starkers_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
* @since Starkers HTML5 3.0
*/
function starkers_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'starkers' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'starkers' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'starkers' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
// change excerpt length
function custom_excerpt_length( $length ) {
return 50;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function getTopParentPostID($myid){
$mypage = get_page($myid);
if ($mypage->post_parent == 0){
return $mypage->ID;
}
else{
return getTopParentPostID($mypage->post_parent);
}
}
function depthToRoot($myid,$depth){
$mypage = get_page($myid);
if ($mypage->post_parent == 0){
return $depth;
}
else{
$depth++;
return depthToRoot($mypage->post_parent, $depth);
}
}