__( 'Primary Menu', 'enterprise' ),
'secondary' => __( 'Secondary Menu', 'enterprise' ),
) );
/**
* Enqueue scripts and styles
*/
function enterprise_scripts() {
wp_enqueue_style( 'enterprise', get_stylesheet_uri() );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
}
add_action( 'wp_enqueue_scripts', 'enterprise_scripts' );
// Get our fallback menu to show a home link
function enterprise_page_menu_args($args) {
$args['show_home'] = true;
return $args;
}
add_filter('wp_page_menu_args', 'enterprise_page_menu_args');
// A custom fallback for the Secondary nav menu
// that display the 10 most popular categories
function enterprise_secondary_cat_menu() { ?>
__( 'Sidebar', 'enterprise' ),
'description' => __( 'This is the main sidebar.', 'enterprise' ),
'before_title'=>'',
'after_title'=>'
',
'before_widget' => '',
'after_widget' => "
"
));
register_sidebar(array(
'name'=> __( 'Footer #1', 'enterprise' ),
'description' => __( 'This is the left column in the footer.', 'enterprise'),
'before_title'=>'',
'after_title'=>'
',
'before_widget' => '',
'after_widget' => "
"
));
register_sidebar(array(
'name'=> __( 'Footer #2', 'enterprise' ),
'description' => __( 'This is the middle column in the footer.', ''),
'before_title'=>'',
'after_title'=>'
',
'before_widget' => '',
'after_widget' => "
"
));
register_sidebar(array(
'name'=> __( 'Footer #3', 'enterprise' ),
'description' => __( 'This is the right column in the footer.', 'enterprise' ),
'before_title'=>'',
'after_title'=>'
',
'before_widget' => '',
'after_widget' => "
"
));
// Template for comments and pingbacks
if ( ! function_exists( 'studiopress_comment' ) ) :
function studiopress_comment( $comment, $args, $depth ) {
$GLOBALS ['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
id="li-comment-">
'',
'default-image' => '',
) ) );
}
add_action( 'after_setup_theme', 'enterprise_register_custom_background' );
/**
* Get the URL of the next image in a gallery for attachment pages
*/
function theme_get_next_attachment_url() {
$k = null;
global $post;
$post = get_post($post);
if ( $post->post_parent ) {
$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++;
if ( isset( $attachments[ $k ] ) )
return get_attachment_link( $attachments[ $k ]->ID );
else
return get_permalink( $post->post_parent );
}
}
/**
* Filters wp_title to print a neat tag based on what is being viewed.
*
* @since Enterprise 1.0
*/
function enterprise_wp_title( $title, $sep ) {
global $page, $paged;
if ( is_feed() )
return $title;
// Add the blog name
$title .= get_bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " $sep $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
$title .= " $sep " . sprintf( __( 'Page %s', 'enterprise' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'enterprise_wp_title', 10, 2 );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Load Jetpack compatibility file.
*/
if ( file_exists( get_template_directory() . '/inc/jetpack.php' ) )
require get_template_directory() . '/inc/jetpack.php';