'FFFFFF', 'text' => '000000', 'link' => '006699', 'border' => 'E5E5E5', 'url' => 'AED4E7', ); /** * Load Jetpack compatibility file. */ require( get_template_directory() . '/inc/jetpack.compat.php' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'custom-background' ); add_theme_support( 'print-style' ); /** * Enqueue scripts and styles */ function depo_square_scripts() { global $wp_styles; wp_enqueue_style( 'depo-square', get_stylesheet_uri() ); wp_enqueue_style( 'depo-square-ie', get_template_directory_uri() . '/ie6.css', array( 'depo-square' ) ); $wp_styles->add_data( 'depo-square-ie', 'conditional', 'IE 6' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'depo_square_scripts' ); function depo_square_register_widgets() { register_widget( 'Widget_DePoFlickr' ); wp_register_sidebar_widget( 'depo-square-about', __( 'DePo Square About', 'depo-square' ), 'depo_square_about_widget' ); wp_register_sidebar_widget( 'depo-square-status', __( 'DePo Square Status', 'depo-square' ), 'depo_square_status_widget' ); } add_action( 'widgets_init', 'depo_square_register_widgets' ); function depo_square_register_sidebars() { register_sidebar( array( 'name' => __( 'Left', 'depo-square' ), 'description' => __( 'An empty left header widget area will show your blog tagline.', 'depo-square' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '
Setup your post type categories to have your latest status message appear here.
array( 'id' => 'type-post', 'proper_name' => 'Articles' ), 'status' => array( 'id' => 'type-status', 'proper_name' => 'Statuses' ), 'quote' => array( 'id' => 'type-quote', 'proper_name' => 'Quotes' ), 'links' => array( 'id' => 'type-link', 'proper_name' => 'Links' ), 'photo' => array( 'id' => 'type-photo', 'proper_name' => 'Photos' ) ); function depo_post_category_html () { $type = depo_post_type(); if (! $type || 'type-post' == $type ) echo ''; else echo ''; } function depo_post_type() { global $depo_post_types; $custom = false; foreach( $depo_post_types as $key => $option ) { $cat = get_option( $option['id'] ); if ( ! empty( $cat ) && in_category( $cat ) ) { $custom = $option; break; } } return $custom ? $custom : $depo_post_types['post']; } function depo_post_category () { $type = depo_post_type(); $type = $type['id']; return ( ! $type || 'type-post' == $type ) ? 'type-post' : $type; } // type-photo functions function replace_empty_tag($m) { $no_replace = array('embed'); // expand as required if ( in_array( strtolower($m[1]), $no_replace ) ) return $m[0]; // return the original untouched return ''; } // remove image tag from post_content for display function image_above($entry) { // don't scrape the image for the feed if (is_feed()) { return $entry; } $entry = str_replace('[/wp_caption]','', $entry); $entry = str_replace('[/caption]','', $entry); //remove image tag $image = preg_replace('/]*src=(\"|\').+?(\1)[^>]*\/*>/','', $entry); //remove any empty tags left by the scrape. $entry = str_replace('', '', $entry); $entry = preg_replace_callback( '|<([a-z]+)[^>]*>\s*\1>|i', 'replace_empty_tag', $entry ); $entry = preg_replace_callback( '|<([a-z]+)[^>]*>\s*\1>|i', 'replace_empty_tag', $entry ); $entry = preg_replace_callback( '|<([a-z]+)[^>]*>\s*\1>|i', 'replace_empty_tag', $entry ); return $image.$entry; } //admin interface if( is_admin() ) { add_action('admin_menu', 'deposquare_add_page'); function deposquare_add_page() { add_theme_page(__('Theme Options'), __('Theme Options'), 'edit_theme_options', 'theme_options', 'deposquare_do_page'); } function deposquare_do_page() { global $depo_post_types; if( isset( $_POST['action'] ) && 'update' == $_POST['action'] && isset( $_POST['depo_square_nonce'] ) && wp_verify_nonce( $_POST['depo_square_nonce'], 'depo_square_save_theme_options' ) && current_user_can( 'edit_theme_options' ) ) { foreach( $depo_post_types as $key => $option ) { if( $_POST[ $option['id'] ] ) update_option( $option['id'], esc_attr( $_POST[ $option['id'] ] ) ); } } foreach( $depo_post_types as $key => $option ) { register_setting( 'deposquareops', $option['id'], 'intval' ); } ?>
* Your RSS feed can be found on your Flickr homepage. Scroll down to the bottom of the page until you see the Feed link and copy that into the box above.
Leave the Flickr RSS URL blank to display interesting Flickr photos.
'; } } function depo_squared_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>