'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 ''; } } /** * ---------------------------------------------------------------------------------------- * 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' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_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' => '

', 'after_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 '
' . __('Read More', 'alpha-nx-one') . '
'; } 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' ); } // setting page function alpha_nx_one_custom_options(){ global $alpha_nx_one; //add Favicon and Apple Icons if(isset($alpha_nx_one['favicon']['url'])){ echo ''; } if(isset($alpha_nx_one['apple_touch_icon']['url'])){ echo '';} ?> 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; } ?>