'Sidebar', 'id' => 'sidebar', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); } add_theme_support( 'menus' ); add_theme_support( 'automatic-feed-links' ); paginate_comments_links(); add_custom_background(); wp_enqueue_script( 'comment-reply' ); register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'blogazine' ), ) ); register_nav_menus( array( 'secondary' => __( 'Secondary Navigation', 'blogazine' ), ) ); //Paste this into your template where you want the menu to go: //wp_nav_menu(array('container_class' => 'menu-header', 'menu_id' => 'menu-navigation', 'theme_location' => 'primary')); function wpe_excerptlength_news($length) { return 15; } function wpe_excerptlength_teaser($length) { return 35; } function wpe_excerptlength_index($length) { return 160; } function wpe_excerptmore($more) { return ' ...'; } function wpe_excerpt($length_callback='', $more_callback='') { global $post; if(function_exists($length_callback)){ add_filter('excerpt_length', $length_callback); } if(function_exists($more_callback)){ add_filter('excerpt_more', $more_callback); } $output = get_the_excerpt(); $output = apply_filters('wptexturize', $output); $output = apply_filters('convert_chars', $output); $output = '

    '.$output.'

    '; echo $output; } /* Fire our meta box setup function on the post editor screen. */ add_action( 'load-post.php', 'booru_post_meta_boxes_setup' ); add_action( 'load-post-new.php', 'booru_post_meta_boxes_setup' ); /* Meta box setup function. */ function booru_post_meta_boxes_setup() { /* Add meta boxes on the 'add_meta_boxes' hook. */ add_action( 'add_meta_boxes', 'booru_add_post_meta_boxes' ); /* Save post meta on the 'save_post' hook. */ add_action( 'save_post', 'booru_save_post_meta', 10, 2 ); } /* Create one or more meta boxes to be displayed on the post editor screen. */ function booru_add_post_meta_boxes() { add_meta_box( 'featured-oembed', // Unique ID esc_html__( 'oEmbed Featured URL', 'example' ), // Title 'booru_post_meta_box', // Callback function 'post', // Admin page (or post type) 'side', // Context 'high' // Priority ); } /* Display the post meta box. */ function booru_post_meta_box( $object, $box ) { ?>


    post_type ); /* Check if the current user has permission to edit the post. */ if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; /* Get the posted data and sanitize it for use as an HTML class. */ $new_meta_value = ( $_POST['featured-oembed'] ); /* Get the meta key. */ $meta_key = 'booru_oembed'; /* Get the meta value of the custom field key. */ $meta_value = get_post_meta( $post_id, $meta_key, true ); /* If a new meta value was added and there was no previous value, add it. */ if ( $new_meta_value && '' == $meta_value ) add_post_meta( $post_id, $meta_key, $new_meta_value, true ); /* If the new meta value does not match the old value, update it. */ elseif ( $new_meta_value && $new_meta_value != $meta_value ) update_post_meta( $post_id, $meta_key, $new_meta_value ); /* If there is no new meta value but an old value exists, delete it. */ elseif ( '' == $new_meta_value && $meta_value ) delete_post_meta( $post_id, $meta_key, $meta_value ); } function autoset_featured() { global $post; $already_has_thumb = has_post_thumbnail($post->ID); if (!$already_has_thumb) { $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" ); if ($attached_image) { foreach ($attached_image as $attachment_id => $attachment) { set_post_thumbnail($post->ID, $attachment_id); } } } } //end function add_action('the_post', 'autoset_featured'); add_action('save_post', 'autoset_featured'); add_action('draft_to_publish', 'autoset_featured'); add_action('new_to_publish', 'autoset_featured'); add_action('pending_to_publish', 'autoset_featured'); add_action('future_to_publish', 'autoset_featured'); /******************************************************************* * @Author: Boutros AbiChedid * @Date: March 20, 2011 * @Websites: http://bacsoftwareconsulting.com/ * http://blueoliveonline.com/ * @Description: Numbered Page Navigation (Pagination) Code. * @Tested: Up to WordPress version 3.1.2 (also works on WP 3.3.1) ********************************************************************/ /* Function that Rounds To The Nearest Value. Needed for the pagenavi() function */ function round_num($num, $to_nearest) { /*Round fractions down (http://php.net/manual/en/function.floor.php)*/ return floor($num/$to_nearest)*$to_nearest; } /* Function that performs a Boxed Style Numbered Pagination (also called Page Navigation). Function is largely based on Version 2.4 of the WP-PageNavi plugin */ function pagenavi($before = '', $after = '') { global $wpdb, $wp_query; $pagenavi_options = array(); $pagenavi_options['pages_text'] = ('Page %CURRENT_PAGE% of %TOTAL_PAGES%:'); $pagenavi_options['current_text'] = '%PAGE_NUMBER%'; $pagenavi_options['page_text'] = '%PAGE_NUMBER%'; $pagenavi_options['first_text'] = ('First Page'); $pagenavi_options['last_text'] = ('Last Page'); $pagenavi_options['next_text'] = 'Next »'; $pagenavi_options['prev_text'] = '« Previous'; $pagenavi_options['dotright_text'] = '...'; $pagenavi_options['dotleft_text'] = '...'; $pagenavi_options['num_pages'] = 5; //continuous block of page numbers $pagenavi_options['always_show'] = 0; $pagenavi_options['num_larger_page_numbers'] = 0; $pagenavi_options['larger_page_numbers_multiple'] = 5; //If NOT a single Post is being displayed /*http://codex.wordpress.org/Function_Reference/is_single)*/ if (!is_single()) { $request = $wp_query->request; //intval - Get the integer value of a variable /*http://php.net/manual/en/function.intval.php*/ $posts_per_page = intval(get_query_var('posts_per_page')); //Retrieve variable in the WP_Query class. /*http://codex.wordpress.org/Function_Reference/get_query_var*/ $paged = intval(get_query_var('paged')); $numposts = $wp_query->found_posts; $max_page = $wp_query->max_num_pages; //empty - Determine whether a variable is empty /*http://php.net/manual/en/function.empty.php*/ if(empty($paged) || $paged == 0) { $paged = 1; } $pages_to_show = intval($pagenavi_options['num_pages']); $larger_page_to_show = intval($pagenavi_options['num_larger_page_numbers']); $larger_page_multiple = intval($pagenavi_options['larger_page_numbers_multiple']); $pages_to_show_minus_1 = $pages_to_show - 1; $half_page_start = floor($pages_to_show_minus_1/2); //ceil - Round fractions up (http://us2.php.net/manual/en/function.ceil.php) $half_page_end = ceil($pages_to_show_minus_1/2); $start_page = $paged - $half_page_start; if($start_page <= 0) { $start_page = 1; } $end_page = $paged + $half_page_end; if(($end_page - $start_page) != $pages_to_show_minus_1) { $end_page = $start_page + $pages_to_show_minus_1; } if($end_page > $max_page) { $start_page = $max_page - $pages_to_show_minus_1; $end_page = $max_page; } if($start_page <= 0) { $start_page = 1; } $larger_per_page = $larger_page_to_show*$larger_page_multiple; //round_num() custom function - Rounds To The Nearest Value. $larger_start_page_start = (round_num($start_page, 10) + $larger_page_multiple) - $larger_per_page; $larger_start_page_end = round_num($start_page, 10) + $larger_page_multiple; $larger_end_page_start = round_num($end_page, 10) + $larger_page_multiple; $larger_end_page_end = round_num($end_page, 10) + ($larger_per_page); if($larger_start_page_end - $larger_page_multiple == $start_page) { $larger_start_page_start = $larger_start_page_start - $larger_page_multiple; $larger_start_page_end = $larger_start_page_end - $larger_page_multiple; } if($larger_start_page_start <= 0) { $larger_start_page_start = $larger_page_multiple; } if($larger_start_page_end > $max_page) { $larger_start_page_end = $max_page; } if($larger_end_page_end > $max_page) { $larger_end_page_end = $max_page; } if($max_page > 1 || intval($pagenavi_options['always_show']) == 1) { /*http://php.net/manual/en/function.str-replace.php */ /*number_format_i18n(): Converts integer number to format based on locale (wp-includes/functions.php*/ $pages_text = str_replace("%CURRENT_PAGE%", number_format_i18n($paged), $pagenavi_options['pages_text']); $pages_text = str_replace("%TOTAL_PAGES%", number_format_i18n($max_page), $pages_text); echo $before.''.$after."\n"; } } } ?>