Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( function_exists( 'add_theme_support' ) ) {
- add_theme_support( 'post-thumbnails' );
- add_image_size( 'homethumb', 260, 304, true );
- add_image_size( 'sliderthumb', 620, 280, true );
- }
- function custom_excerpt_length( $length ) {
- return 46;
- }
- add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
- add_filter('post_limits', 'my_limit_posts');
- function my_limit_posts($limit){
- return "LIMIT 4";
- }
- $wp_query = new WP_Query('posts_per_page=4&category_name=destaque');
- remove_filter('post_limits', 'my_limit_posts');
- function theme_add_scripts() {
- wp_enqueue_script('jquery');
- wp_enqueue_script('nivoslider', get_bloginfo('stylesheet_directory').'/js/jquery.nivo.slider.pack.js', 'jquery', '2.1');
- wp_enqueue_script('nivoslider-custom', get_bloginfo('stylesheet_directory').'/js/slider.js', 'jquery');
- }
- add_action('init', 'theme_add_scripts');
- function theme_add_styles() {
- wp_enqueue_style('nivoslider', get_bloginfo('stylesheet_directory').'/js/nivo-slider.css', false, '2.1');
- }
- add_action('init', 'theme_add_styles');
- register_sidebar( array(
- 'name'=>'Barra lateral Direita',
- 'before_widget' => '<div id="%1$s" class="%2$s">',
- 'after_widget' => '</div>',
- 'before_title' => '<div class="titlebar">',
- 'after_title' => '</div>',
- ) );
- /*Pagination */
- function kriesi_pagination($pages = '', $range = 2)
- {
- $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 "<div class='pagination'>";
- if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>«</a>";
- if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹</a>";
- for ($i=1; $i <= $pages; $i++)
- {
- if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
- {
- echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
- }
- }
- if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>›</a>";
- if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>»</a>";
- echo "</div>\n";
- }
- }
- /*Autor Box */
- function extra_contact_info($contactmethods) {
- unset($contactmethods['yim']);
- unset($contactmethods['jabber']);
- $contactmethods['facebook'] = 'Facebook';
- $contactmethods['twitter'] = 'Twitter';
- return $contactmethods;
- }
- add_filter('user_contactmethods', 'extra_contact_info');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement