get_template_directory_uri() . '/images/default-logo.png',
'random-default' => false,
'width' => 250,
'height' => 150,
'flex-height' => true,
'flex-width' => true,
'header-text' => false,
'uploads' => true
));
//Add theme support for JetPack infinite-scroll
add_theme_support('infinite-scroll', array(
'type' => 'scroll',
'container' => 'content',
'footer' => false,
'wrapper' => true,
'render' => false,
'posts_per_page' => false
));
//Add theme support for post-thumbnails.
add_theme_support('post-thumbnails');
//Add theme support for woocommerce.
add_theme_support('woocommerce');
//Add theme support for custom-menus.
register_nav_menus(array(
'top-menu' => __('Top Menu', 'autoadjust'),
'primary-menu' => __('Primary Menu', 'autoadjust'),
'secondary-menu' => __('Secondary Menu', 'autoadjust'),
'footer-menu' => __('Footer Menu', 'autoadjust'),
'bottom-menu' => __('Bottom Menu', 'autoadjust')
));
}
endif;
/* WIDIGITS INITIALIZATION
--------------------------------------------------------------- */
add_action('widgets_init', 'autoadjust_widgets_init');
if(!function_exists('autoadjust_widgets_init')):
function autoadjust_widgets_init() {
//Sidebar widgets
register_sidebar(array(
'name' => __('Sidebar Widgets', 'autoadjust'),
'id' => 'sidebar-widgets',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
//Header widgets
register_sidebar(array(
'name' => __('Header Widgets', 'autoadjust'),
'id' => 'header-widgets',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
//Footer widgets
register_sidebar(array(
'name' => __('Footer Widgets', 'autoadjust'),
'id' => 'footer-widgets',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
}
endif;
/* TITLE FILTER
--------------------------------------------------------------- */
function autoadjust_wp_title($title, $sep) {
global $paged, $page;
if (is_feed()) :
return $title;
endif;
$title .= get_bloginfo( 'name' );
$site_description = get_bloginfo('description', 'display');
if ($site_description && (is_home() || is_front_page())) :
$title = "$title $sep $site_description";
endif;
if ($paged >= 2 || $page >= 2) :
$title = "$title $sep " . sprintf( __( 'Page %s', 'autoadjust' ), max( $paged, $page ) );
endif;
return $title;
}
add_filter('wp_title', 'autoadjust_wp_title', 10, 2);
/* GET LOGO
--------------------------------------------------------------- */
function autoadjust_get_logo() { ?>
';
echo edit_post_link(__('(Edit)', 'autoadjust'));
echo '';
endif;
}
/* BEFORE THE ENTRY
--------------------------------------------------------------- */
if(!function_exists('autoadjust_entry_before')) :
function autoadjust_entry_before() {
printf(__('Posted by %3$son %5$s
', 'autoadjust'),
'before',
'author',
sprintf('%2$s',
get_author_posts_url(get_the_author_meta('ID')),
esc_attr(get_the_author())
),
'date',
sprintf('%1$s',
esc_html(get_the_date())
));
}
endif;
/* LOOP NAVIGATION
--------------------------------------------------------------- */
function autoadjust_pagination() {
if(class_exists('Jetpack') && Jetpack::is_module_active('infinite-scroll')) :
//Infinite scroll is active
else :
get_template_part('pagination');
endif;
}
/* AFTER THE ENTRY
--------------------------------------------------------------- */
if(!function_exists('autoadjust_entry_after')) :
function autoadjust_entry_after() {
if(comments_open() || has_tag() || has_category()) :
echo '';
autoadjust_entry_comments();
autoadjust_entry_tags();
autoadjust_entry_category();
echo '
';
endif;
}
endif;
/* THE ENTRY COMMENTS
--------------------------------------------------------------- */
function autoadjust_entry_comments() {
if(comments_open()) :
echo '';
endif;
}
/* THE ENTRY TAGS
--------------------------------------------------------------- */
function autoadjust_entry_tags() {
if(has_tag()) :
echo '';
echo the_tags(__('Tagged with ', 'autoadjust') . ' ', ', ', '');
echo '';
endif;
}
/* THE ENTRY CATEGORY
--------------------------------------------------------------- */
function autoadjust_entry_category() {
if(has_category()) :
echo '';
echo _e('Posted in ', 'autoadjust').the_category(', ');
echo '';
endif;
}
function autoadjust_enqueue_comment_reply() {
if(is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'autoadjust_enqueue_comment_reply');
?>