max_num_pages; } if ( !$paged ) $paged = 1; $nextpage = intval($paged) + 1; if ( (! is_single()) && (empty($paged) || $nextpage <= $max_page) ) { echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } } function nofollow_previous_posts_link($label='« Previous Page') { global $paged; if ( (!is_single()) && ($paged > 1) ) { $prevpage = intval($paged) - 1; echo ''. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .''; } } function nofollow_post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) { $url = get_post_comments_feed_link($post_id, $feed); if ( empty($link_text) ) $link_text = __('Comments Feed'); echo "$link_text"; } function nofollow_comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off', $nofollow = true ) { global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; if ( is_single() || is_page() ) return; $number = get_comments_number( $id ); if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) { echo '' . $none . ''; return; } if ( !empty($post->post_password) ) { // if there's a password if ( !isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) { // and it doesn't match the cookie echo __('Enter your password to view comments'); return; } } echo ''; comments_number( $zero, $one, $more, $number ); echo ''; } // get_ Updates for your theme's attachment.php file function get_adjacent_image_link($prev = true) { global $post; $post = get_post($post); $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') )); foreach ( $attachments as $k => $attachment ) if ( $attachment->ID == $post->ID ) break; $k = $prev ? $k - 1 : $k + 1; if ( isset($attachments[$k]) ) return wp_get_attachment_link($attachments[$k]->ID, 'thumbnail', true); } function get_previous_image_link() { return get_adjacent_image_link(true); } function get_next_image_link() { return get_adjacent_image_link(false); } function nofollow_get_the_category_list( $separator = '', $parents='', $post_id = false ) { global $wp_rewrite; $categories = get_the_category( $post_id ); if ( empty( $categories ) ) return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); $rel = ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) ? 'rel="category tag nofollow"' : 'rel="category nofollow"'; $thelist = ''; if ( '' == $separator ) { $thelist .= ''; } else { $i = 0; foreach ( $categories as $category ) { if ( 0 < $i ) $thelist .= $separator . ' '; switch ( strtolower( $parents ) ) { case 'multiple': if ( $category->parent ) $thelist .= get_category_parents( $category->parent, true, $separator ); $thelist .= 'name ) . '" ' . $rel . '>' . $category->cat_name.''; break; case 'single': $thelist .= 'name ) . '" ' . $rel . '>'; if ( $category->parent ) $thelist .= get_category_parents( $category->parent, false, $separator ); $thelist .= "$category->cat_name"; break; case '': default: $thelist .= 'name ) . '" ' . $rel . '>' . $category->name.''; } ++$i; } } return apply_filters( 'the_category', $thelist, $separator, $parents ); } function nofollow_the_category( $separator = '', $parents='', $post_id = false ) { echo nofollow_get_the_category_list( $separator, $parents, $post_id ); } function nofollow_get_the_category( $separator = '', $parents='', $post_id = false ) { return nofollow_get_the_category_list( $separator, $parents, $post_id ); } ?>