post_parent ) && $image->post_parent != $id )
$url .= '#main';
return $url;
}
add_filter( 'attachment_link', 'accessiblezen_enhanced_image_navigation', 10, 2 );
/**
* Filters wp_title to print a neat
tag based on what is being viewed.
*/
function accessiblezen_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', '_s' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'accessiblezen_wp_title', 10, 2 );
/**
* Sets the post excerpt length to 100 words.
*
* To override this length in a child theme, remove the filter and add your own
* function tied to the excerpt_length filter hook.
*/
function accessiblezen_excerpt_length( $length ) {
return 100;
}
add_filter( 'excerpt_length', 'accessiblezen_excerpt_length' );
if ( ! function_exists( 'accessiblezen_continue_reading_link' ) ) :
/**
* Returns a "Continue Reading" link for excerpts
*/
function accessiblezen_continue_reading_link() {
return ' ' . ('Continue reading ' . the_title('', '', false) . '' . '');
}
endif; // accessiblezen_continue_reading_link
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and accessiblezen_continue_reading_link().
*
* To override this in a child theme, remove the filter and add your own
* function tied to the excerpt_more filter hook.
*/
function accessiblezen_auto_excerpt_more( $more ) {
return ' …' . accessiblezen_continue_reading_link();
}
add_filter( 'excerpt_more', 'accessiblezen_auto_excerpt_more' );
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
*
* To override this link in a child theme, remove the filter and add your own
* function tied to the get_the_excerpt filter hook.
*/
function accessiblezen_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= accessiblezen_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'accessiblezen_custom_excerpt_more' );
/**
* Return the URL for the first link found in the post content.
*
* @since accessiblezen 1.0
* @return string|bool URL or false when no link is present.
*/
function accessiblezen_get_link_url() {
if ( ! preg_match( '/]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
return false;
return esc_url_raw( $matches[1] );
}
/**
* Adds a styles to the header to correspond with the Theme Customizer settings.
* @since accessiblezen 1.0
*/
function accessiblezen_hide_tagline( $wp_customize ) {
$options = get_theme_mod( 'displayblogname' );
if ( $options == '' ) {
?>