get( 'cat' ) ) : get_tag_feed_link( $wp_query->get( 'tag_id' ) ) ); $catdescription = ( ( is_category() && category_description() ) ? category_description() : false ); $tagdescription = ( ( is_tag() && tag_description() ) ? tag_description() : false ); $taxdesc = ( is_category() ? $catdescription : $tagdescription ); $taxdescdefault = __( 'Posts filed under ', 'oenology' ) . $taxtitle; $taxdescription = ( $taxdesc ? $taxdesc : $taxdescdefault ); } // If this is a Post Format archive elseif ( is_tax( 'post_format', 'post-format-' . get_post_format() ) ) { $tax = get_post_format(); $taxtitle = get_post_format_string( $tax ); $taxfeedlink = get_post_format_link( $tax ) . '/feed/'; $taxdescription = false; $formats = oenology_get_post_formats(); foreach ( $formats as $format ) { if ( $format['slug'] == $tax ) { $taxdescription = '' . $format['description'] . ''; } } } // If this is a Custom Taxonoomy archive elseif ( is_tax() ) { global $wp_query; $tax = $wp_query->query_vars['taxonomy']; $term = $wp_query->query_vars['term']; $taxobject = get_taxonomy( $tax ); $termobject = get_term_by( 'slug', $term, $tax ); $taxtitle = single_term_title( '', false ); $taxfeedlink = get_term_link( $term, $tax ) . '/feed/'; $taxdescription = $termobject->description; } $loop_header .= '
'; $loop_header .= ''; $loop_header .= '
' . $taxtitle . ' feed
'; $loop_header .= '
'; $loop_header .= '

' . $taxtitle . '

'; $loop_header .= '
' . $taxdescription . '
'; } } // If this is a search results page elseif ( is_search() ) { $loop_header .= '

Results for "' . get_search_query() . '" Search

'; $loop_header .= '
'; $loop_header .= '' . __( 'Search', 'oenology' ) . ':' . __( 'to inquire, investigate, examine, or seek; conduct an examination or investigation.', 'oenology' ) . '' . __( 'Below are all posts and pages related to the indicated search query.', 'oenology' ); $loop_header .= '
'; } echo apply_filters( 'oenology_hook_loop_header', $loop_header ); } /** * Hook to filter content displayed in the Loop if no Posts are found * * This hook can be used to filter to content that is * output in the div#post container when have_posts() * returns false. * * Template file: loop.php * * @since Oenology 2.2 */ function oenology_hook_loop_no_posts() { $loop_no_posts = ''; $loop_no_posts .= '

' . __( 'Not Found', 'oenology' ) . '

'; $loop_no_posts .= '

' . __( 'Sorry, but you are looking for something that isn\'t here.', 'oenology' ) . '

'; echo apply_filters( 'oenology_hook_loop_no_posts', $loop_no_posts ); } /** * Hook to filter content displayed on Error 404 pages * * This hook can be used to filter to content that is * output in the div#post-entry container on Error * 404 pages. * * Template file: 404.php * * @uses apply_filters() * @uses get_avatar() * @uses get_the_author_meta() * @uses is_page() * * @since Oenology 2.0 */ function oenology_hook_post_404() { $post_404 = oenology_get_404_content(); echo apply_filters( 'oenology_hook_post_404', $post_404 ); } /** * Hook to filter content within div#postmetadata * * This hook can be used to filter to content that is output in the div#postmetadata container. * * Template file: post-footer.php * * @uses apply_filters() * @uses get_avatar() * @uses get_the_author_meta() * @uses is_page() * * @since Oenology 2.0 */ function oenology_hook_post_footer_avatar() { // don't display the author's avatar on Pages global $post; if ( ! is_page() && 'page' != $post->post_type ) { // display a 20px avatar, to fit inside the post footer $avatar = get_avatar( get_the_author_meta( 'email' ), $size = '20' ); $post_footer_avatar = apply_filters( 'oenology_hook_post_footer_avatar', $avatar ); echo '' . $post_footer_avatar . ''; } } /** * Hook to filter content within div#postmetadata * * This hook can be used to filter to content that is output in the div#postmetadata container. To * use this hook, simply pass a string containing the license text. This string is automatically * wrapped in the appropriate container tags. If nothing * is passed to this filter, then nothing is output by default. * * Template file: post-footer.php * * @return string * * @uses apply_filters() * * @since Oenology 2.0 */ function oenology_hook_post_footer_license() { $license = ''; $license = apply_filters( 'oenology_hook_post_footer_license', $license ); if ( '' != $license ) { $post_footer_license = ''; $post_footer_license .= ''; $post_footer_license .= $license; $post_footer_license .= ''; echo $post_footer_license; } } /** * Hook to filter Post Footer Metadata * * This hook can be used to filter to content that is * output in the div#postmetadata container. * * Template file: post-footer.php * * @uses apply_filters() * @uses get_bloginfo() * @uses get_comments_number() * @uses get_edit_post_link() * @uses get_option() * @uses get_permalink() * @uses get_post_format() * @uses get_post_format_link() * @uses get_post_format_string() * @uses get_the_author() * @uses get_the_date() * @uses get_the_time() * @uses has_post_format() * @uses is_page() * @uses is_user_logged_in() * * @since Oenology 2.0 */ function oenology_hook_post_footer_metadata() { $post_footer_metadata = array(); global $post; if ( ! is_page() && 'page' != $post->post_type ) { $oenology_post_format_string = ( get_post_format() ? '' . get_post_format_string( get_post_format() ) . '' : 'Posted' ); $post_footer_metadata['post-format-string'] = $oenology_post_format_string; $post_footer_metadata['post-format-string'] .= ' by ' . get_the_author() . ' '; if ( has_post_format( 'aside' ) || has_post_format( 'link' ) || has_post_format( 'quote' ) || has_post_format( 'status' ) ) { $post_footer_metadata['permalink'] = '' . get_the_date( get_option( 'date_format' ) ) . ' at ' . get_the_time( get_option( 'time_format' ) ) . ''; // Display total number of post comments $post_footer_metadata['comments'] = ' (' . get_comments_number() . ') '; if ( is_user_logged_in() ) { // Display "Edit" link for logged-in Admin users $post_footer_metadata['editlink'] = '' . __( 'Edit', 'oenology' ) . ''; } } else { $post_footer_metadata['timestamp'] = get_the_date( get_option( 'date_format' ) ) . ' at ' . get_the_time( get_option( 'time_format' ) ); } } else { $post_footer_metadata['copyright'] = '© ' . get_bloginfo( 'name' ); } echo '' . implode( '', apply_filters( 'oenology_hook_post_footer_metadata', $post_footer_metadata ) ) . ''; } /** * Hook to filter Post Header Date * * This hook can be used to filter to content that is * output in the div#post-title container. * * Template file: post-header.php * * @uses apply_filters() * @uses get_the_time() * @uses is_attachment() * @uses is_page() * * @since Oenology 2.0 */ function oenology_hook_post_header_date() { global $post; // don't display timestamp on Pages if ( 'post' == get_post_type() ) { $post_header_date = array(); // Post Date: Year $post_header_date_year = get_the_time('Y'); $post_header_date['year'] = '' . apply_filters( 'oenology_hook_post_header_date_year', $post_header_date_year ) . ''; // Post Date: Weekday $post_header_date_weekday = get_the_time('D'); $post_header_date['weekday'] = '' . apply_filters( 'oenology_hook_post_header_date_weekday', $post_header_date_weekday ) . ''; // Post Date: Day of Month $post_header_date_day = get_the_time('d'); $post_header_date['day'] = '' . apply_filters( 'oenology_hook_post_header_date_day', $post_header_date_day ) . ''; // Post Date: Month $post_header_date_month = get_the_time('M'); $post_header_date['month'] = '' . apply_filters( 'oenology_hook_post_header_date_month', $post_header_date_month ) . ''; echo '' . implode( '', apply_filters( 'oenology_hook_post_header_date', $post_header_date ) ) . ''; } } /** * Hook to filter Post Header Metadata Links * * This hook can be used to filter to content that is * output in the div#post-title container. * * Template file: post-header.php * * @uses apply_filters() * @uses get_comments_number() * @uses get_edit_post_link() * @uses get_permalink() * @uses get_the_ID() * @uses get_the_title() * @uses get_trackback_url() * @uses is_attachment() * @uses is_page() * @uses is_singular() * @uses is_user_logged_in() * @uses wp_get_shortlink() * * @since Oenology 2.0 */ function oenology_hook_post_header_metadata() { $post_header_metadata = array(); // Post Permalink $permalink = ''; $permalink .= '' . __( 'Permalink', 'oenology' ) . ''; $permalink .= ''; $post_header_metadata['permalink'] = $permalink; // Post Metadata Links global $post; if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { if ( ! is_attachment() ) { // Shortlink $shortlink = '' . __( 'Shortlink', 'oenology' ) . ''; $post_header_metadata['shortlink'] = $shortlink; } // Comments Link $commentslink = ''; $commentslink .= __( 'Comments', 'oenology' ) . ' (' . get_comments_number() . ')'; $commentslink .= ' '; $post_header_metadata['commentslink'] = $commentslink; // Trackback $trackbacklink = '' . __( 'Trackback', 'oenology' ) . ''; $post_header_metadata['trackbacklink'] = $trackbacklink; } if ( is_singular() ) { // only display a Print link on single posts, pages, and attachments // Print Link $printlink = 'Print'; $post_header_metadata['printlink'] = $printlink; } if ( is_user_logged_in() ) { // Edit Post Link $editlink = '' . __( 'Edit', 'oenology' ) . ''; // Display "Edit" link for logged-in Admin users $post_header_metadata['editlink'] = $editlink; } echo '' . implode( ' | ', apply_filters( 'oenology_hook_post_header_metadata', $post_header_metadata ) ) . ''; } /** * Hook to filter Post Header Taxonomies * * This hook can be used to filter to content that is * output in the div#post-title container. * * Template file: post-header.php * * @uses apply_filters() * @uses get_the_category_list() * @uses get_the_tag_list() * @uses is_page() * * @since Oenology 2.0 */ function oenology_hook_post_header_taxonomies() { $post_header_taxonomies = array(); // Post Taxonomies global $post; if ( 'post' == get_post_type() ) { // Category List $post_header_taxonomies['categorylist'] = ''; $post_header_taxonomies['categorylist'] .= sprintf( __( 'Filed in %s', 'oenology' ), get_the_category_list( ', ' ) ); $post_header_taxonomies['categorylist'] .= ''; // Tag List if ( get_the_tag_list() ) { $post_header_taxonomies['taglist'] = ''; $post_header_taxonomies['taglist'] .= sprintf( __( 'Tags: %s', 'oenology' ), get_the_tag_list( '', ', ', '' ) ); $post_header_taxonomies['taglist'] .= ''; } } echo '' . implode( '', apply_filters( 'oenology_hook_post_header_taxonomies', $post_header_taxonomies ) ) . ''; } /** * Hook to filter Post Header Title * * This hook can be used to filter to content that is * output in the div#post-title container. * * Template file: post-header.php * * @uses apply_filters() * @uses get_permalink() * @uses get_the_title() * * @since Oenology 2.0 */ function oenology_hook_post_header_title() { $post_header_title = ''; if ( ! is_singular() && ( has_post_format( 'gallery' ) || has_post_format( 'image' ) ) ) { // display post title, no link $post_header_title = '

' . get_the_title() . '

'; } else { // link Post Headline (H1) to post permalink $post_header_title = '

' . get_the_title() . '

'; } echo apply_filters( 'oenology_hook_post_header_title', $post_header_title ); } /** * Hook to filter Post Header Thumbnail * * This hook can be used to filter to content that is * output in the div#post-title container. * * Template file: post-header.php * * @uses apply_filters() * @uses get_post_format() * @uses get_the_post_thumbnail() * @uses has_post_thumbnail() * @uses is_attachment() * @uses is_home() * @uses is_page() * @uses is_single() * * @since Oenology 2.0 */ function oenology_hook_post_header_thumbnail() { // display the post thumbnail in the post header for search and archive pages, since they are excerpted // don't display for custom Post Formats, since icons are displayed if ( ( ! ( is_home() || is_single() || is_page() || is_attachment() ) ) && has_post_thumbnail() && ! get_post_format() ) { $post_header_thumbnail = ''; global $post; $post_header_thumbnail = get_the_post_thumbnail( $post->ID, 'post-title-thumbnail' ); echo '' . apply_filters( 'oenology_hook_post_header_thumbnail', $post_header_thumbnail ) . ''; } } /** * Hook to filter site footer content * * This hook can be used to filter to content that is * output in the div#postmetadata container. By default, * it builds an associative array: * - $site_footer['copyright'] => the site copyright notice * - $site_footer['wordpress'] => the WordPress credit * - $site_footer['themecredit'] => the Theme credit (if enabled) * * The filter is passed on the array, before the array * is imploded. So to modify the output, add, remove, or * modify the array keys. * * Template file: footer.php * * @uses apply_filters() * @uses date() * @uses function_exists() * @uses get_bloginfo() * @uses get_template_directory_uri() * @uses home_url() * @uses oenology_copyright() * @uses oenology_get_footer_credit() * * @since Oenology 2.0 */ function oenology_hook_site_footer() { $site_footer = array(); $site_footer['copyright'] = '' . get_bloginfo('name') . ' '; // if the oenology_copyright() function exists, // use it to output the copyright date span // otherwise, just output the current year if ( function_exists( 'oenology_copyright' ) ) { // function to output XXXX-YYYY, // where 'XXXX' is the year of the oldest post, // and 'YYYY' is the current year $site_footer['copyright'] .= oenology_copyright(); } else { // current year $site_footer['copyright'] .= '© ' . date('Y'); } $site_footer['wordpress'] = sprintf( __( 'Powered by %s', 'oenology' ), 'WordPress ' . get_bloginfo( 'version' ) . '' ); global $oenology_options; if ( 'true' == $oenology_options['display_footer_credit'] ) { // Disabled by default $site_footer['themecredit'] = 'Oenology Theme'; } $site_footer['feed'] = ''; echo implode( ' | ', apply_filters( 'oenology_hook_site_footer', $site_footer ) ); } /** * Hook to filter site header text content * * This hook can be used to filter to content that is * output in the div#site-header-text container. By * default, it outputs the Site Title inside a DIV with * a class .site-header-text, and the Site Description * inside paragraph tags. * * Template file: site-header.php * * @uses apply_filters() * @uses get_bloginfo() * * @since Oenology 2.0 */ function oenology_hook_site_header() { $site_header = ''; $site_header_name = ( 'blank' != get_header_textcolor() ? get_bloginfo( 'name' ) : ' ' ); $site_header_description = ( 'blank' != get_header_textcolor() ? get_bloginfo( 'description' ) : ' ' ); // Displays the blog name, as defined on the General Settings page in the administration panel $site_header .= '
' . $site_header_name . '
'; // Displays the blog description, as defined on the General Settings page in the administration panel $site_header .= '

' . $site_header_description . '

'; echo apply_filters( 'oenology_hook_site_header', $site_header, $site_header_name, $site_header_description ); }