'ffffff',
'default-image' => '',
) ) );
/**
* Register nav menus.
*/
add_theme_support('menus');
register_nav_menus(
array(
'main-menu' => __( 'Primary Menu', 'alpha_nx_one' )
)
);
}
add_action( 'after_setup_theme', 'alpha_nx_one_setup' );
}
/**
* ----------------------------------------------------------------------------------------
* 3.0 - Display meta information for a specific post. alpha_nx_one
* ----------------------------------------------------------------------------------------
*/
if ( ! function_exists( 'alpha_nx_one_post_meta' ) ) {
function alpha_nx_one_post_meta() {
echo '
';
if ( get_post_type() == 'post' ) {
// If the post is sticky, mark it.
if ( is_sticky() ) {
echo '- ' . __( 'Sticky', 'alpha_nx_one' ) . '
';
}
// Get the post author.
printf(
'- %2$s
',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
// Get the date.
echo '- ' . get_the_date() . '
';
// The categories.
$category_list = get_the_category_list( ', ' );
if ( $category_list ) {
echo '- ' . $category_list . '
';
}
// Comments link.
if ( comments_open()) :
echo '- ';
echo '';
comments_popup_link( __( 'Leave a comment', 'alpha_nx_one' ), __( 'One comment', 'alpha_nx_one' ), __( 'View all % comments', 'alpha_nx_one' ) );
echo '';
echo '
';
endif;
// Edit link.
if ( is_user_logged_in() ) {
echo '- ';
edit_post_link( __( 'Edit', 'alpha_nx_one' ), '', '' );
echo '
';
}
}
echo '
';
}
}
/**
* ----------------------------------------------------------------------------------------
* 4.0 - Display navigation to the next/previous set of posts.
* ----------------------------------------------------------------------------------------
*/
if ( ! function_exists( 'alpha_nx_one_paging_nav' ) ) :
function alpha_nx_one_paging_nav() {
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
$url_parts = explode( '?', $pagenum_link );
if ( isset( $url_parts[1] ) ) {
wp_parse_str( $url_parts[1], $query_args );
}
$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );
$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';
$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
// Set up paginated links.
$links = paginate_links( array(
'base' => $pagenum_link,
'format' => $format,
'total' => $GLOBALS['wp_query']->max_num_pages,
'current' => $paged,
'mid_size' => 3,
'add_args' => array_map( 'urlencode', $query_args ),
'prev_text' => __( '← Previous', '' ),
'next_text' => __( 'Next →', 'alpha_nx_one' ),
'type' => 'list',
) );
if ( $links ) :
?>
__( 'Main Widget Area', 'alpha_nx_one' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages.', 'alpha_nx_one' ),
'before_widget' => ' ',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => __( 'Footer Widget Area', 'alpha_nx_one' ),
'id' => 'sidebar-2',
'description' => __( 'Appears on the footer.', 'alpha_nx_one' ),
'before_widget' => ' ',
'before_title' => '',
)
);
}
}
add_action( 'widgets_init', 'alpha_nx_one_widget_init' );
}
/**
* ----------------------------------------------------------------------------------------
* 6.0 - Add read more in post without page and single page
* ----------------------------------------------------------------------------------------
*/
function excerpt_more( $more ) {
return '';
}
add_filter( 'excerpt_more', 'excerpt_more' );
/**
* ----------------------------------------------------------------------------------------
* 7.0 - Breadcrumbs
* ----------------------------------------------------------------------------------------
*/
if ( ! function_exists( 'alpha_nx_one_breadcrumbs' ) ) {
function alpha_nx_one_breadcrumbs() {
global $post;
if (!is_home()) {
echo "";
echo "Home";
echo "";
if (is_category() || is_single()) {
echo ' ';
$cats = get_the_category( $post->ID );
foreach ( $cats as $cat ){
echo $cat->cat_name;
echo ' ';
}
if (is_single()) {
the_title();
}
}
elseif (is_page()) {
if($post->post_parent){
$anc = get_post_ancestors( $post->ID );
$anc_link = get_page_link( $post->post_parent );
foreach ( $anc as $ancestor ) {
$output = " > ".get_the_title($ancestor).' ';
}
echo $output;
the_title(); }
else {
echo ' ';
echo the_title();
}
}
}
elseif (is_tag()) {single_tag_title();}
elseif (is_day()) {echo"Archive: "; get_the_time('F jS, Y'); echo'';}
elseif (is_month()) {echo"Archive: "; get_the_time('F, Y'); echo'';}
elseif (is_year()) {echo"Archive: "; get_the_time('Y'); echo'';}
elseif (is_author()) {echo"Author's archive: "; echo'';}
elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "Blogarchive: "; echo'';}
elseif (is_search()) {echo"Search results: "; }
}
}
if ( ! function_exists( 'alpha_nx_one_post_title' ) ) {
function alpha_nx_one_post_title() {
global $post;
if (!is_home()) {
if (is_single()) {
the_title();
}
elseif (is_page()) {
if($post->post_parent){
$anc = get_post_ancestors( $post->ID );
$anc_link = get_page_link( $post->post_parent );
foreach ( $anc as $ancestor ) {
$output = " > ".get_the_title($ancestor)." > ";
}
echo $output;
the_title(); }
else {
echo the_title();
}
}
}
}
}
/**
* ----------------------------------------------------------------------------------------
* 8.0 - Add them option in wordpress
* ----------------------------------------------------------------------------------------
*/
if ( ! function_exists( 'redux_disable_dev_mode_plugin' ) ) {
function redux_disable_dev_mode_plugin( $redux ) {
if ( $redux->args['opt_name'] != 'redux_demo' ) {
$redux->args['dev_mode'] = false;
}
}
add_action( 'redux/construct', 'redux_disable_dev_mode_plugin' );
}
if (!isset($redux_demo)){
require_once(dirname(__FILE__) . '/theme_admin.php');
}
// Show recommended plugin and install it
include 'tgm/tgm-init.php';
/**
* ----------------------------------------------------------------------------------------
* 9.0 - Load the custom scripts for the theme.
* ----------------------------------------------------------------------------------------
*/
if ( ! function_exists( 'alpha_nx_one_header_scripts' ) ) {
function alpha_nx_one_header_scripts() {
// Adds support for pages with threaded comments
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
//load fonts
$protocol = is_ssl() ? 'https' : 'http';
// Register scripts
wp_enqueue_script( 'alpha_nx_one-smoothscroll', SCRIPTS . '/smoothscroll.js', array('jquery') );
wp_enqueue_script( 'alpha_nx_one-custom', SCRIPTS . '/custom.js', array('jquery') );
wp_enqueue_script( 'mousewheel', get_stylesheet_uri() . '/fancybox/lib/jquery.mousewheel-3.0.6.pack.js', array('jquery') );
wp_enqueue_script( 'fancybox', get_template_directory_uri() . '/js/jquery.fancybox.pack.js', array( 'jquery' ), false, true );
wp_enqueue_script( 'lightbox', get_template_directory_uri() . '/js/lightbox.js', array( 'fancybox' ), false, true );
// Load the stylesheets
wp_enqueue_style( 'main-style', get_stylesheet_uri() );
wp_enqueue_style( 'font-awesome', STYLESHEET . '/font-awesome.css' );
wp_enqueue_style( 'responsive', STYLESHEET . '/responsive.css');
wp_enqueue_style( 'lightbox-style', get_template_directory_uri() . '/css/jquery.fancybox.css' );
}
add_action( 'wp_enqueue_scripts', 'alpha_nx_one_header_scripts' );
}
if ($alpha_nx_one[Comments] == '0' || $alpha_nx_one[Comments] != '1') {
function alpha_nx_one_disable_comments_status() {
return false;
}
add_filter('comments_open', 'alpha_nx_one_disable_comments_status', 20, 2);
add_filter('pings_open', 'alpha_nx_one_disable_comments_status', 20, 2);
}
// setting page
function alpha_nx_one_custom_options(){
global $alpha_nx_one;
if($alpha_nx_one[date_and_time]=='0'){
$date_and_time= '#post_details .meta-date{display:none;}';
}
//add Favicon and Apple Icons
?>
1 ) :
echo "n";
echo "n";
endif;
}
add_action( 'wp_head', 'alpha_nx_one_canonical_for_comments' );
add_filter('widget_tag_cloud_args','set_tag_cloud_sizes');
function set_tag_cloud_sizes($args) {
$args['smallest'] = 8;
$args['largest'] = 8;
return $args; }
?>