__( 'Primary Menu', 'autmunport' ),
) );
add_theme_support('post-thumbnails');
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// custom backgrounds
$Autmun_port_custom_background = array(
// Background color default
'default-color' => 'ffffff',
// Background image default
'default-image' => '',
'wp-head-callback' => '_custom_background_cb'
);
add_theme_support('custom-background', $Autmun_port_custom_background );
// adding post format support
add_theme_support( 'post-formats',
array(
'aside', /* Typically styled without a title. Similar to a Facebook note update */
'gallery', /* A gallery of images. Post will likely contain a gallery shortcode and will have image attachments */
'link', /* A link to another site. Themes may wish to use the first link tag in the post content as the external link for that post. An alternative approach could be if the post consists only of a URL, then that will be the URL and the title (post_title) will be the name attached to the anchor for it */
'image', /* A single image. The first tag in the post could be considered the image. Alternatively, if the post consists only of a URL, that will be the image URL and the title of the post (post_title) will be the title attribute for the image */
'quote', /* A quotation. Probably will contain a blockquote holding the quote content. Alternatively, the quote may be just the content, with the source/author being the title */
'status', /*A short status update, similar to a Twitter status update */
'video', /* A single video. The first tag or object/embed in the post content could be considered the video. Alternatively, if the post consists only of a URL, that will be the video URL. May also contain the video as an attachment to the post, if video support is enabled on the blog (like via a plugin) */
'audio', /* An audio file. Could be used for Podcasting */
'chat' /* A chat transcript */
)
);
}
endif;
add_action( 'after_setup_theme', 'Autmun_port_setup' );
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! function_exists( 'Autmun_port_content_width' ) ) :
function Autmun_port_content_width() {
global $content_width;
if (!isset($content_width))
$content_width = 550; /* pixels */
}
endif;
add_action( 'after_setup_theme', 'Autmun_port_content_width' );
/**
* Title filter
*/
if ( ! function_exists( 'Autmun_port_filter_wp_title' ) ) :
function Autmun_port_filter_wp_title( $old_title, $sep, $sep_location ) {
if ( is_feed() ) return $old_title;
$site_name = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
// add padding to the sep
$ssep = ' ' . $sep . ' ';
if ( $site_description && ( is_home() || is_front_page() ) ) {
return $site_name . ' | ' . $site_description;
} else {
// find the type of index page this is
if( is_category() ) $insert = $ssep . __( 'Category', 'autmunport' );
elseif( is_tag() ) $insert = $ssep . __( 'Tag', 'autmunport' );
elseif( is_author() ) $insert = $ssep . __( 'Author', 'autmunport' );
elseif( is_year() || is_month() || is_day() ) $insert = $ssep . __( 'Archives', 'autmunport' );
else $insert = NULL;
// get the page number we're on (index)
if( get_query_var( 'paged' ) )
$num = $ssep . __( 'Page ', 'autmunport' ) . get_query_var( 'paged' );
// get the page number we're on (multipage post)
elseif( get_query_var( 'page' ) )
$num = $ssep . __( 'Page ', 'autmunport' ) . get_query_var( 'page' );
// else
else $num = NULL;
// concoct and return new title
return $site_name . $insert . $old_title . $num;
}
}
endif;
// call our custom wp_title filter, with normal (10) priority, and 3 args
add_filter( 'wp_title', 'Autmun_port_filter_wp_title', 10, 3 );
/*******************************************************************
* These are settings for the Theme Customizer in the admin panel.
*******************************************************************/
if ( ! function_exists( 'Autmun_port_theme_customizer' ) ) :
function Autmun_port_theme_customizer( $wp_customize ) {
$wp_customize->remove_section( 'title_tagline');
/* logo option */
$wp_customize->add_section( 'Autmun_port_logo_section' , array(
'title' => __( 'Site Logo', 'autmunport' ),
'priority' => 31,
'description' => __( 'Upload a logo to replace the default site name in the header', 'autmunport' ),
) );
$wp_customize->add_setting( 'Autmun_port_logo' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'Autmun_port_logo', array(
'label' => __( 'Choose your logo (ideal width is 100-300px and ideal height is 40-100px)', 'autmunport' ),
'section' => 'Autmun_port_logo_section',
'settings' => 'Autmun_port_logo',
) ) );
/* color theme */
$wp_customize->add_setting( 'Autmun_port_theme_color', array (
'default' => '#DD3333',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'Autmun_port_theme_color', array(
'label' => __( 'Theme Color Option', 'autmunport' ),
'section' => 'colors',
'settings' => 'Autmun_port_theme_color',
'priority' => 101,
) ) );
/* author bio in posts option */
$wp_customize->add_section( 'Autmun_port_author_bio_section' , array(
'title' => __( 'Display Author Bio', 'autmunport' ),
'priority' => 32,
'description' => __( 'Option to show/hide the author bio in the posts.', 'autmunport' ),
) );
$wp_customize->add_setting( 'Autmun_port_author_bio' );
$wp_customize->add_control('author_bio', array(
'settings' => 'Autmun_port_author_bio',
'label' => __('Show the author bio in posts?', 'autmunport'),
'section' => 'Autmun_port_author_bio_section',
'type' => 'checkbox',
));
/* slider options */
$wp_customize->add_section( 'Autmun_port_slider_section' , array(
'title' => __( 'Slider Options', 'autmunport' ),
'priority' => 33,
'description' => __( 'Adjust the behavior of the image slider.', 'autmunport' ),
) );
$wp_customize->add_setting( 'Autmun_port_slider_effect', array(
'default' => 'scrollHorz',
'capability' => 'edit_theme_options',
));
$wp_customize->add_control( 'effect_select_box', array(
'settings' => 'Autmun_port_slider_effect',
'label' => __( 'Select Effect:', 'autmunport' ),
'section' => 'Autmun_port_slider_section',
'type' => 'select',
'choices' => array(
'scrollHorz' => 'Horizontal (Default)',
'scrollVert' => 'Vertical',
'tileSlide' => 'Tile Slide',
'tileBlind' => 'Blinds',
'shuffle' => 'Shuffle',
),
));
$wp_customize->add_setting( 'Autmun_port_slider_timeout' );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'Autmun_port_slider_timeout', array(
'label' => __( 'Autoplay Speed in Seconds', 'autmunport' ),
'section' => 'Autmun_port_slider_section',
'settings' => 'Autmun_port_slider_timeout',
) ) );
}
endif;
add_action('customize_register', 'Autmun_port_theme_customizer');
/**
* Apply Color Scheme
*/
if ( ! function_exists( 'Autmun_port_apply_color' ) ) :
function Autmun_port_apply_color() {
if ( get_theme_mod('Autmun_port_theme_color') ) {
?>
'primary', /* where in the theme it's assigned */
'container_class' => 'menu', /* div container class */
'fallback_cb' => 'Autmun_port_main_nav_fallback' /* menu fallback */
)
);
}
endif;
if ( ! function_exists( 'Autmun_port_main_nav_fallback' ) ) :
function Autmun_port_main_nav_fallback() { wp_page_menu( 'show_home=Home&container_class=menu' ); }
endif;
if ( ! function_exists( 'Autmun_port_enqueue_comment_reply' ) ) :
function Autmun_port_enqueue_comment_reply() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
endif;
add_action( 'comment_form_before', 'Autmun_port_enqueue_comment_reply' );
if ( ! function_exists( 'Autmun_port_page_menu_args' ) ) :
function Autmun_port_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
endif;
add_filter( 'wp_page_menu_args', 'Autmun_port_page_menu_args' );
/**
* Register widgetized area and update sidebar with default widgets
*/
function Autmun_port_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'autmunport' ),
'id' => 'sidebar-right',
'before_widget' => '",
'before_title' => '
';
}
/** Link to current page, plus 2 pages in either direction if necessary */
sort( $links );
foreach ( (array) $links as $link ) {
$class = $paged == $link ? ' class="active"' : '';
printf( '
' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $max );
}
/** Next Post Link */
if ( get_next_posts_link() )
printf( '
%s
' . "\n", get_next_posts_link() );
echo '
' . "\n";
}
endif;
/**
* Add "Untitled" for posts without title,
*/
function Autmun_port_post_title($title) {
if ($title == '') {
return __('Untitled', 'autmunport');
} else {
return $title;
}
}
add_filter('the_title', 'Autmun_port_post_title');
/**
* Fix for W3C validation
*/
if ( ! function_exists( 'Autmun_port_w3c_valid_rel' ) ) :
function Autmun_port_w3c_valid_rel( $text ) {
$text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text;
}
endif;
add_filter( 'the_category', 'Autmun_port_w3c_valid_rel' );
/*
* Modernizr functions
*/
if ( ! function_exists( 'Autmun_port_modernizr_addclass' ) ) :
function Autmun_port_modernizr_addclass($output) {
return $output . ' class="no-js"';
}
endif;
add_filter('language_attributes', 'Autmun_port_modernizr_addclass');
if ( ! function_exists( 'Autmun_port_modernizr_script' ) ) :
function Autmun_port_modernizr_script() {
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/library/js/modernizr-2.6.2.min.js', false, '2.6.2');
}
endif;
add_action('wp_enqueue_scripts', 'Autmun_port_modernizr_script');
/**
* Excerpt
*/
if ( ! function_exists( 'Autmun_port_excerpt' ) ) :
function Autmun_port_excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
return $excerpt;
}
endif;
/**
* Get Embed Video for post format video
*/
if ( ! function_exists('Autmun_port_featured_video') ) :
function Autmun_port_featured_video( &$content ) {
$url = trim( array_shift( explode( "\n", $content ) ) );
$w = get_option( 'embed_size_w' );
if ( !is_single() )
$url = str_replace( '448', $w, $url );
if ( 0 === strpos( $url, 'http://' ) ) {
echo apply_filters( 'the_content', $url );
$content = trim( str_replace( $url, '', $content ) );
} else if ( preg_match ( '#^<(script|iframe|embed|object)#i', $url ) ) {
$h = get_option( 'embed_size_h' );
if ( !empty( $h ) ) {
if ( $w === $h ) $h = ceil( $w * 0.75 );
$url = preg_replace(
array( '#height="[0-9]+?"#i', '#height=[0-9]+?#i' ),
array( sprintf( 'height="%d"', $h ), sprintf( 'height=%d', $h ) ),
$url
);
}
echo $url;
$content = trim( str_replace( $url, '', $content ) );
}
}
endif;
/**
* Enqueue scripts & styles
*/
if ( ! function_exists( 'Autmun_port_custom_scripts' ) ) :
function Autmun_port_custom_scripts() {
wp_register_script( 'imagesloaded', get_template_directory_uri() . '/library/js/imagesloaded.pkgd.min.js');
wp_register_script( 'cycle2', get_template_directory_uri() . '/library/js/jquery.cycle2.min.js' );
wp_register_script( 'cycle2_tile', get_template_directory_uri() . '/library/js/jquery.cycle2.tile.min.js' );
wp_register_script( 'cycle2_shuffle', get_template_directory_uri() . '/library/js/jquery.cycle2.shuffle.min.js' );
wp_register_script( 'cycle2_scrollvert', get_template_directory_uri() . '/library/js/jquery.cycle2.scrollVert.min.js' );
wp_register_script( 'masonry', get_template_directory_uri() . '/library/js/masonry.pkgd.min.js' );
wp_enqueue_script( 'Autmun_port_custom_js', get_template_directory_uri() . '/library/js/scripts.js', array( 'jquery', 'imagesloaded', 'cycle2', 'cycle2_tile', 'cycle2_shuffle', 'cycle2_scrollvert', 'masonry' ), '1.0.0' );
wp_enqueue_style( 'Autmun_port_style', get_stylesheet_uri() );
}
endif;
add_action('wp_enqueue_scripts', 'Autmun_port_custom_scripts');
/**
*
* This script will prompt the users to install the plugin required to
* enable the "Menu Item" custom post type for Restaurateur theme.
*
* @package TGM-Plugin-Activation
* @subpackage Example
* @version 2.3.6
* @author Thomas Griffin
* @author Gary Jones
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
* @link https://github.com/thomasgriffin/TGM-Plugin-Activation
*/
/**
* Include the TGM_Plugin_Activation class.
*/
require_once dirname( __FILE__ ) . '/library/class/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'restaurateur_register_required_plugins' );
/**
* Register the required plugins for this theme.
*
* The variable passed to tgmpa_register_plugins() should be an array of plugin
* arrays.
*
* This function is hooked into tgmpa_init, which is fired within the
* TGM_Plugin_Activation class constructor.
*/
function restaurateur_register_required_plugins() {
/**
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/
$plugins = array(
// This is an example of how to include a plugin pre-packaged with a theme
array(
'name' => 'WP Jurist People CPT', // The plugin name
'slug' => 'autmunport-people-cpt', // The plugin slug (typically the folder name)
'source' => get_stylesheet_directory() . '/library/plugin/autmunport-people-cpt.zip', // The plugin source
'required' => false, // If false, the plugin is only 'recommended' instead of required
'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins
'external_url' => '', // If set, overrides default API URL and points to an external URL
),
);
// Change this to your theme text domain, used for internationalising strings
$theme_text_domain = 'autmunport';
/**
* Array of configuration settings. Amend each line as needed.
* If you want the default strings to be available under your own theme domain,
* leave the strings uncommented.
* Some of the strings are added into a sprintf, so see the comments at the
* end of each line for what each argument will be.
*/
$config = array(
'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme.
'default_path' => '', // Default absolute path to pre-packaged plugins
'parent_menu_slug' => 'themes.php', // Default parent menu slug
'parent_url_slug' => 'themes.php', // Default parent URL slug
'menu' => 'install-required-plugins', // Menu slug
'has_notices' => true, // Show admin notices or not
'is_automatic' => true, // Automatically activate plugins after installation or not
'message' => '', // Message to output right before the plugins table
'strings' => array(
'page_title' => __( 'Install Required Plugins', 'autmunport' ),
'menu_title' => __( 'Install Plugins', 'autmunport' ),
'installing' => __( 'Installing Plugin: %s', 'autmunport' ), // %1$s = plugin name
'oops' => __( 'Something went wrong with the plugin API.', 'autmunport' ),
'notice_can_install_required' => _n_noop( 'To enable the "Poeple" custom post type, this theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
'return' => __( 'Return to Required Plugins Installer', 'autmunport' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'autmunport' ),
'complete' => __( 'All plugins installed and activated successfully. %s', 'autmunport' ), // %1$s = dashboard link
'nag_type' => 'updated' // Determines admin notice type - can only be 'updated' or 'error'
)
);
tgmpa( $plugins, $config );
}
$args = array(
'default-image' => '',
'random-default' => false,
'width' => 0,
'height' => 0,
'flex-height' => false,
'flex-width' => false,
'default-text-color' => '',
'header-text' => true,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-header', $args ) ;
?>