__( 'Primary Menu', 'appworx' )
) );
// Content width
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 1170;
}
/*
* Enable support for Post Formats.
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'appworx_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
) );
}
endif;
add_action( 'after_setup_theme', 'appworx_setup' );
/**
* Theme preloader
*/
function appworx_preloader() {
?>
%2$s';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '%2$s %4$s ';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
_x( '%s', 'post date', 'appworx' ),
'' . $time_string . ' '
);
$byline = sprintf(
_x( '%s', 'post author', 'appworx' ),
'' . esc_html( get_the_author() ) . ' '
);
$tags = get_the_tags();
$singletag = '';
$tagsline = '';
if( $tags) :
foreach( $tags as $tag ){
$singletag .= ''. esc_html( $tag->name ) .' ';
}
$tagsline = ''.$singletag .' ';
endif;
$category = get_the_category();
$singlecategory = '';
$categoryline = '';
$comments = '';
if($category) :
foreach( $category as $cat ){
$singlecategory .= ''. esc_html( $cat->name ) .' ';
}
$categoryline = '' . $singlecategory . ' ';
endif;
if($layout == 'classic-alt'){
$comments = '';
}
echo '' . $posted_on . ' ' . $byline . ' ' . $comments . $categoryline . $tagsline;
}
endif;
if ( ! function_exists( 'appworx_grid_post_meta' ) ) :
function appworx_grid_post_meta(){
$time_string = '%2$s %3$s ';
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date('j') ),
esc_html( get_the_date('M, y') )
);
$posted_on = sprintf(
_x( '%s', 'post date', 'appworx' ),
'' . $time_string . ' '
);
$byline = sprintf(
_x( '%s', 'post author', 'appworx' ),
'' . esc_html( get_the_author() ) . ' '
);
$comments = '';
echo '' . $posted_on . ' ' . $byline . ' '. '';
}
endif;
// Changing excerpt more
function appworx_excerpt_more($more) {
global $post;
$layout = appworx_blog_layout();
return ' .... ' . __('Read More', 'appworx') . ' ';
}
add_filter('excerpt_more', 'appworx_excerpt_more');
/**
* Enqueue scripts and styles.
*/
function appworx_scripts() {
wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/css/owl.carousel.css' );
wp_enqueue_style( 'owl.theme', get_template_directory_uri() . '/css/owl.theme.css' );
wp_enqueue_style( 'appworx-fonts', esc_url( appworx_google_fonts() ), array(), null );
wp_enqueue_style( 'appworx-style', get_stylesheet_uri() );
wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.css' );
wp_enqueue_script( 'appworx-main', get_template_directory_uri() . '/js/main.js', array('jquery'), '20180213', true );
wp_enqueue_script( 'owl.carousel.min', get_template_directory_uri() . '/js/owl.carousel.min.js', array('jquery'), '20180213', true );
wp_enqueue_script( 'wow.min', get_template_directory_uri() . '/js/wow/wow.min.js', array('jquery'), '20180213', true );
wp_enqueue_style( 'appworx-font-awesome', get_template_directory_uri() . '/fonts/font-awesome.min.css' );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'appworx_scripts' );
/**
* Fonts
*/
if ( !function_exists('appworx_google_fonts') ) :
function appworx_google_fonts() {
$body_font = get_theme_mod('body_font_name', 'Poppins:400,600');
$headings_font = get_theme_mod('headings_font_name', 'Ubuntu:400,400i,500,500i');
$fonts = array();
$fonts[] = esc_attr( str_replace( '+', ' ', $body_font ) );
$fonts[] = esc_attr( str_replace( '+', ' ', $headings_font ) );
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) )
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
function appworx_header_background() {
$title = get_theme_mod('header_title_1', __('Welcome to Appworx', 'appworx'));
$fornt_img = get_theme_mod('background_image_right',get_stylesheet_directory_uri() . '/images/banner-img-01.png');
$subtitle = get_theme_mod('header_subtitle_1', __('Delivers more than expected', 'appworx'));
$subpera = get_theme_mod('header_subpera_1', __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet ullamcorper erat', 'appworx'));
$button_icon = get_theme_mod('o2_fa_icon_picker', '');
$button_text1 = get_theme_mod('banner_button1', __('Ready to start', 'appworx'));
$button_text2 = get_theme_mod('banner_button2', __('Ready to start', 'appworx'));
$button_url1 = get_theme_mod('banner_button_url1', '#');
$button_url2 = get_theme_mod('banner_button_url2', '#');
$front_header_type = get_theme_mod('front_header_type', 'image');
$site_header_type = get_theme_mod('site_header_type', 'image');
if ( $front_header_type == 'image' && is_front_page() ) :
?>
__( 'Sidebar', 'appworx' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
//Footer widget areas
$widget_areas = get_theme_mod('footer_widget_areas', '3');
for ($i=1; $i<=$widget_areas; $i++) {
register_sidebar( array(
'name' => __( 'Footer ', 'appworx' ) . $i,
'id' => 'footer-' . $i,
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
}
add_action( 'widgets_init', 'appworx_widgets_init' );
/**
* Enqueue Bootstrap
*/
function appworx_enqueue_bootstrap() {
wp_enqueue_style( 'appworx-bootstrap', get_template_directory_uri() . '/css/bootstrap/bootstrap.min.css', array(), true );
}
add_action( 'wp_enqueue_scripts', 'appworx_enqueue_bootstrap', 9 );
/**
* Custom-Header
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Styles
*/
require get_template_directory() . '/inc/styles.php';
/**
* Recommended plugins
*/
require get_template_directory() . '/recommend/class-tgm-plugin-activation.php';
/**
* Upsell
*/
require get_template_directory() . '/upsell/class-customize.php';
/**
* Demo content
*/
require_once dirname( __FILE__ ) . '/demo-content/demo-content-setup.php';
function appworx_recommend_plugin() {
$plugins[] = array(
'name' => 'Elementor',
'slug' => 'elementor',
'required' => false,
);
$plugins[] = array(
'name' => 'Contact Form 7',
'slug' => 'contact-form-7',
'required' => false,
);
$plugins[] = array(
'name' => 'Bizworx Tools',
'slug' => 'bizworx-tools',
'required' => false,
);
tgmpa( $plugins);
}
add_action( 'tgmpa_register', 'appworx_recommend_plugin' );
if ( ! function_exists( 'appworx_edit_link' ) ) :
/**
* Returns an accessibility-friendly link to edit a post or page.
*
* This also gives us a little context about what exactly we're editing
* (post or page?) so that users understand a bit more where they are in terms
* of the template hierarchy and their content. Helpful when/if the single-page
* layout with multiple posts/pages shown gets confusing.
*/
function appworx_edit_link() {
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( ' Edit "%s" ', 'appworx' ),
get_the_title()
),
'',
' '
);
}
endif;
/**
* Generate breadcrumbs
*/
function get_breadcrumb() {
echo ''.__('Home', 'appworx').' ';
if (is_category() || is_single()) {
echo " / ";
the_category(' • ');
if (is_single()) {
echo " / ";
the_title();
}
} elseif (is_page()) {
echo " / ";
echo the_title();
} elseif (is_search()) {
echo __(" / Search Results for... ", "appworx");
echo '"';
echo the_search_query();
echo ' "';
}
}
function tn_custom_excerpt_length( $length ) {
$exce_len = get_theme_mod('exc_lenght', 25);
return $exce_len;
}
add_filter( 'excerpt_length', 'tn_custom_excerpt_length', 999 );