get( 'Version' ) );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'footer-scripts', get_template_directory_uri() . '/js/footer-scripts.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'affiliateblogwriter_script_enqueue' );
/**
* Theme setup
*/
function affiliateblogwriter_theme_setup() {
add_theme_support( 'title-tag' );
load_theme_textdomain( 'affiliateblogwriter', get_template_directory() . '/languages' );
/* Theme features */
add_theme_support( 'custom-background' );
add_theme_support( 'automatic-feed-links' );
/* Featured images */
add_theme_support( 'post-thumbnails', array( 'post' ) );
add_image_size( 'affiliateblogwriter-featured-image', 200, 150, true );
add_image_size( 'affiliateblogwriter-featured-image-2x', 400, 300, true );
add_image_size( 'affiliateblogwriter-featured-image-4x', 800, 600, true );
/* Post formats */
add_theme_support( 'post-formats', array( 'image', 'video' ) );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Enqueue editor styles.
add_editor_style( 'style-editor.css' );
}
add_action( 'init', 'affiliateblogwriter_theme_setup' );
if ( ! function_exists( 'affiliateblogwriter_register_nav_menus' ) ) {
/**
* Register Nav menus
*/
function affiliateblogwriter_register_nav_menus() {
register_nav_menus(
array(
'top-menu' => __( 'Top menu', 'affiliateblogwriter' ),
'main-menu' => __( 'Main menu', 'affiliateblogwriter' ),
'footer-menu' => __( 'Footer menu', 'affiliateblogwriter' ),
'small-mobile-menu' => __( 'Small mobile menu', 'affiliateblogwriter' ),
)
);
}
add_action( 'after_setup_theme', 'affiliateblogwriter_register_nav_menus', 0 );
}
/**
* Sidebars
*/
function affiliateblogwriter_widget_setup() {
register_sidebar(
array(
'name' => 'Main Sidebar',
'id' => 'main-sidebar',
'description' => 'This is the main sidebar located at the right of every page. For mobile screens it will be pushed to the bottom of the page instead, before the bottom sidebar.',
'before_widget' => '
',
'after_widget' => "
\n",
'before_title' => '\n",
)
);
register_sidebar(
array(
'name' => 'Bottom Sidebar',
'id' => 'bottom-sidebar',
'description' => 'This is the bottom sidebar located at the bottom of every page.',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
)
);
register_sidebar(
array(
'name' => 'Outer Right Sidebar',
'id' => 'outer-right-sidebar',
'description' => 'This sidebar is suitable for 160px wide banner ads. Scrolls with the page. Will not be displayed on small screens.',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
)
);
register_sidebar(
array(
'name' => 'Outer Left Sidebar',
'id' => 'outer-left-sidebar',
'description' => 'This sidebar is suitable for 160px wide banner ads. Scrolls with the page. Will not be displayed on small screens.',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
)
);
register_sidebar(
array(
'name' => 'Central Call to Action',
'id' => 'central-cta-sidebar',
'description' => 'This sidebar is really just suitable for placing one call to action link in a widget or similar.',
'before_widget' => '',
'after_widget' => "
\n",
'before_title' => '\n",
)
);
}
add_action( 'widgets_init', 'affiliateblogwriter_widget_setup' );
/* Custom functions */
require get_template_directory() . '/inc/customization.php';
/**
* Disable the extra read more links
*/
function affiliateblogwriter_modify_read_more_link() {
return '';
}
add_filter( 'the_content_more_link', 'affiliateblogwriter_modify_read_more_link' );
/**
* Comments reply
*/
function affiliateblogwriter_enqueue_comments_reply() {
if ( get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'comment_form_before', 'affiliateblogwriter_enqueue_comments_reply' );
/**
* Post Pagination Links
*/
function affiliateblogwriter_post_pagination() {
the_posts_pagination(
array(
'prev_text' => __( 'Previous', 'affiliateblogwriter' ),
'next_text' => __( 'Next', 'affiliateblogwriter' ),
)
);
}
/**
* Post Pagination Links
*/
function affiliateblogwriter_get_pagination() {
return paginate_links(
array(
'prev_text' => __( 'Previous', 'affiliateblogwriter' ),
'next_text' => __( 'Next', 'affiliateblogwriter' ),
)
);
}