post_type !== 'page'; } function ncop_comments_template_filter($file) { return is_page() ? dirname(__FILE__).'/empty' : $file; } add_filter('comments_open', 'ncop_comments_open_filter', 10, 2); add_filter('comments_template', 'ncop_comments_template_filter', 10, 1); // Removes "Comments Are Closed" text add_filter('gettext', 'ps_remove_comments_are_closed', 20, 3); function ps_remove_comments_are_closed($translation, $text, $domain) { $translations = &get_translations_for_domain( $domain ); if ( $text == 'Comments are closed.' ) { return ''; } return $translation; } // Add Thumbnails to RSS Feeds function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '

' . get_the_post_thumbnail($post->ID) . '

' . get_the_content(); } return $content; } add_filter('the_excerpt_rss', 'rss_post_thumbnail'); add_filter('the_content_feed', 'rss_post_thumbnail'); // Pagination add_action('wp_enqueue_scripts', 'add_my_stylesheet'); function add_my_stylesheet() { $myStyleUrl = plugins_url('pagenavi.css', __FILE__); $myStyleFile = WP_PLUGIN_DIR . '/artisteer-buddy/pagenavi.css'; if ( file_exists($myStyleFile) ) { wp_register_style('myStyleSheets', $myStyleUrl); wp_enqueue_style( 'myStyleSheets'); } } function wp_pagenavi($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "
Page ".$paged." of ".$pages.""; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "« First"; if($paged > 1 && $showitems < $pages) echo "‹ Previous"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "".$i."":"".$i.""; } } if ($paged < $pages && $showitems < $pages) echo "Next ›"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "Last »"; echo "
\n"; } }