tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'authority' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'audio', 'quote', 'link', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'wppremium_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); } endif; add_action( 'after_setup_theme', 'wppremium_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function wppremium_content_width() { $GLOBALS['content_width'] = apply_filters( 'wppremium_content_width', 640 ); } add_action( 'after_setup_theme', 'wppremium_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function wppremium_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Header Right', 'authority' ), 'id' => 'header_right', 'description' => '', 'before_widget' => '', 'before_title' => '
id="get_field_id( 'show_excerpt' ); ?>" name="get_field_name( 'show_excerpt' ); ?>" />
'widget_latest_posts', 'description' => __( "Show your latest posts.",'authority') ); parent::__construct('Tmpl_Widget_Latest_Posts', __('Latest Posts','authority'), $widget_ops); $this->alt_option_name = 'widget_latest_posts'; } function widget($args, $instance) { $cache = wp_cache_get('widget_latest_posts', 'widget'); if ( !is_array($cache) ) $cache = array(); if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; if ( isset( $cache[ $args['widget_id'] ] ) ) { echo $cache[ $args['widget_id'] ]; return; } ob_start(); extract($args); extract($args, EXTR_SKIP); echo $args['before_widget']; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']); $post_number = empty($instance['number']) ? '4' : apply_filters('widget_post_number', $instance['number']); $excerpt_length = ( ! empty( $instance['excerpt_length'] ) ) ? absint( $instance['excerpt_length'] ) : 10; $show_excerpt = empty($instance['show_excerpt']) ? '' : apply_filters('widget_show_excerpt', $instance['show_excerpt']); $view = empty($instance['view']) ? 'list' : apply_filters('widget_show_view', $instance['view']); $post_type = 'post'; if($view =='grid'){ $class='grid'; }else{ $class="list"; } echo ''; $catCounter = 0; $pcount=0; if($title){ echo $args['before_title'].$title.$args['after_title']; } ?>
id="get_field_id( 'show_excerpt' ); ?>" name="get_field_name( 'show_excerpt' ); ?>" value="1"/>
'widget Advertise', 'description' => __('common advertise widget in sidebar, bottom section','authority') ); parent::__construct('Tmpl_Adv_Widget', __('Advertisement Widget','authority'), $widget_ops); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); $desc1 = empty($instance['desc1']) ? ' ' : apply_filters('widget_desc1', $instance['desc1']); $double = empty($instance['double']) ? '' : apply_filters('widget_double', $instance['double']); $desc2 = empty($instance['desc2']) ? ' ' : apply_filters('widget_desc2', $instance['desc2']); echo $args['before_widget']; ?>
id="get_field_id( 'double' ); ?>" name="get_field_name( 'double' ); ?>" value="1"/>
style="display:none;" id="get_field_id('desc2'); ?>">
'widget social_media','description'=> apply_filters('tmpl_social_media_description',__('Add icons and links to your social media accounts. Works in header, footer, main content and sidebar widget areas.','authority')) ); parent::__construct('social_media', __('Social Media','authority'), $widget_ops); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); echo $args['before_widget']; echo ' + Add more | - Remove 'widget Newsletter subscribe','description'=> apply_filters('tmpl_subscriber_widget_title',__('Shows a subscribe box with which users can subscribe to your newsletter. Works best in main content, subsidiary and footer areas.','authority') )); parent::__construct('Tmpl_Subscriber_Widget',apply_filters('subscribewidget_filter',__('Newsletter','authority')), $widget_ops); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); global $mailchimp_api_key,$mailchimp_list_id; $feedburner_id = empty($instance['feedburner_id']) ? '' : apply_filters('widget_feedburner_id', $instance['feedburner_id']); $title = empty($instance['title']) ? __("Subscribe To Newsletter",'authority') : apply_filters('widget_title', $instance['title']); $text = empty($instance['text']) ? __("Subscribe to get our latest news",'authority') : apply_filters('widget_text', $instance['text']); $newsletter_provider = empty($instance['newsletter_provider']) ? 'feedburner' : apply_filters('widget_newsletter_provider', $instance['newsletter_provider']); $mailchimp_api_key = empty($instance['mailchimp_api_key']) ? '' : apply_filters('widget_mailchimp_api_key', $instance['mailchimp_api_key']); $mailchimp_list_id = empty($instance['mailchimp_list_id']) ? '' : apply_filters('widget_mailchimp_list_id', $instance['mailchimp_list_id']); $aweber_list_name = empty($instance['aweber_list_name']) ? '' : apply_filters('widget_aweber_list_name', $instance['aweber_list_name']); $feedblitz_list_id = empty($instance['feedblitz_list_id']) ? '' : apply_filters('widget_feedblitz_list_id', $instance['feedblitz_list_id']); add_action('wp_footer','attach_mailchimp_js',100); echo $args['before_widget']; ?> __("Subscribe To Newsletter",'authority'),'text' => __("Subscribe to get our latest news",'authority'),'newsletter_provider'=> 'mailchimp','feedburner_id'=> '','mailchimp_api_key' => '','mailchimp_list_id' => '','aweber_list_name' => '','feedblitz_list_id' => '') ); $feedburner_id = strip_tags($instance['feedburner_id']); $title = strip_tags($instance['title']); $text = strip_tags($instance['text']); $newsletter_provider = strip_tags($instance['newsletter_provider']); $mailchimp_api_key = strip_tags($instance['mailchimp_api_key']); $mailchimp_list_id = strip_tags($instance['mailchimp_list_id']); $aweber_list_name = strip_tags($instance['aweber_list_name']); $feedblitz_list_id = strip_tags($instance['feedblitz_list_id']);?>
'widget Author', 'description' => __('Shows Author information for detail page','authority') ); parent::__construct('Tmpl_Author_Widget', __('Author Widget','authority'), $widget_ops); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $designation = empty($instance['designation']) ? '' : apply_filters('widget_designation', $instance['designation']); $facebook = empty($instance['facebook']) ? '' : apply_filters('widget_facebook', $instance['facebook']); $twitter = empty($instance['twitter']) ? '' : apply_filters('widget_twitter', $instance['twitter']); $pinterest = empty($instance['pinterest']) ? '' : apply_filters('widget_pinterest', $instance['pinterest']); $google = empty($instance['google']) ? '' : apply_filters('widget_google', $instance['google']); global $post; if($post){ $user_info = get_userdata($post->post_author); echo $args['before_widget']; ?> '','designation'=>'', 'facebook'=>'', 'twitter'=>'','pinterest'=>'', 'google'=>'' ) ); $title = sanitize_text_field($instance['title']); $designation = sanitize_text_field($instance['designation']); $facebook = sanitize_text_field($instance['facebook']); $twitter = sanitize_text_field($instance['twitter']); $pinterest = sanitize_text_field($instance['pinterest']); $google = sanitize_text_field($instance['google']); ?>
'widget My Book', 'description' => __('Shows Author book information for detail page','authority') ); parent::__construct('Tmpl_My_Book', __('My Book Widget','authority'), $widget_ops); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $book = empty($instance['book']) ? '' : apply_filters('widget_book', $instance['book']); $book_text = empty($instance['book_text']) ? 'See My New Book' : apply_filters('widget_book_text', $instance['book_text']); $book_url = empty($instance['book_url']) ? '' : apply_filters('widget_book_url', $instance['book_url']); $desc1 = empty($instance['desc1']) ? '' : apply_filters('widget_desc1', $instance['desc1']); global $post; if($post){ $user_info = get_userdata($post->post_author); echo $args['before_widget']; ?> '','book'=>'', 'book_text'=>'', 'book_url'=>'', 'desc1'=>'') ); $title = sanitize_text_field($instance['title']); $book = sanitize_text_field($instance['book']); $book_text = sanitize_text_field($instance['book_text']); $book_url = sanitize_text_field($instance['book_url']); $desc1 = sanitize_text_field($instance['desc1']); ?>
'widget_related_posts', 'description' => __( "Your site’s Related Posts For Detail Page.",'authority') ); parent::__construct('Tmpl_Widget_Related_Posts', __('Related Posts','authority'), $widget_ops); } function widget($args, $instance) { ob_start(); extract($args); $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Related Posts','authority' ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 8; global $post; $taxonomies = get_object_taxonomies( (object) array( 'post_type' => $post->post_type,'public' => true, '_builtin' => true )); /* to fetch related posts by categories */ $terms = wp_get_post_terms($post->ID, $taxonomies[0], array("fields" => "ids")); $postQuery = array( 'post_type' => $post->post_type, 'post_status' => 'publish', 'tax_query' => array( array( 'taxonomy' =>$taxonomies[0], 'field' => 'ID', 'terms' => $terms, 'operator' => 'IN' ) ), 'posts_per_page'=> $number, 'ignore_sticky_posts'=>1, 'orderby' => 'RAND', 'post__not_in' => array($post->ID) ); $my_query = new wp_query($postQuery); $postcount = count($my_query->posts); $posttype_obj = get_post_type_object($post->post_type); $type_post = ""; if($postcount > 1 ){ $type_post = __("Entries",'authority'); }else{ $type_post = __("Entry",'authority'); } echo $args['before_widget']; if ( $title ) echo $args['before_title']. esc_html($title) .$args['after_title'] ; $post_lable = ($posttype_obj->labels->menu_name) ? $posttype_obj->labels->menu_name : $type_post; if( $my_query->have_posts() ) : ?>
%3$s', get_author_posts_url( $authordata->ID, $authordata->user_nicename ), esc_attr( sprintf( __( 'Posts by %s','authority' ), get_the_author() ) ), // No further l10n needed, core will take care of this one get_the_author() ); return $link; } /* get the image of the relevant size pass in argument if no size pass in argument it will return the thumbnail */ function tmpl_get_image_withinfo($iPostID,$img_size='thumb',$no_images='') { $arrImages = get_children('order=ASC&orderby=menu_order ID&post_type=attachment&post_mime_type=image&post_parent=' . @$iPostID ); $counter = 0; $return_arr = array(); if (has_post_thumbnail( $iPostID )){ $img_arr = wp_get_attachment_image_src( get_post_thumbnail_id( $iPostID ), $img_size ); $imgarr['id'] = get_post_thumbnail_id( $iPostID );; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; }else{ if($arrImages) { foreach($arrImages as $key=>$val) { $id = $val->ID; if($val->post_title!="") { if($img_size == 'thumb') { $img_arr = wp_get_attachment_image_src($id, 'thumbnail'); // Get the thumbnail url for the attachment $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; } else { $img_arr = wp_get_attachment_image_src($id, $img_size); $imgarr['id'] = $id; $imgarr['file'] = $img_arr[0]; $return_arr[] = $imgarr; } } $counter++; if($no_images!='' && $counter==$no_images) { break; } } }else{ $imgarr['id'] = 0; $imgarr['file'] = 'http://placehold.it/185x130/333333/999999&text=Thumbnail'; $return_arr[] = $imgarr; } } return $return_arr; } add_action( 'customize_register' , 'theme_footer_options',100 ); function theme_footer_options( $wp_customize ) { global $wp_customize; $wp_customize->remove_section('colors'); $wp_customize->remove_section('header_image'); $wp_customize->remove_section('background_image'); $wp_customize->add_section( 'lifestyle_logo_section' , array( 'title' => __( 'Site Logo', 'authority' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header', ) ); $wp_customize->add_section( 'lifestyle_footer_options', array( 'title' => __( 'Footer Settings', 'authority' ), 'priority' => 100, 'capability' => 'edit_theme_options', 'description' => __('Change footer options here.', 'authority'), ) ); //adding setting for footer text area $wp_customize->add_setting('footer_text', array( 'default' => 'Default Text For Footer Section', 'sanitize_callback' => 'lifestyle_footer_options', )); $wp_customize->add_control('footer_text', array( 'label' => 'Footer Text Here', 'section' => 'lifestyle_footer_options', 'type' => 'textarea', )); $wp_customize->add_section('homepage_settings_section', array( 'title' => 'Homepage banner after second post', 'priority' => 40 )); //adding setting for footer text area $wp_customize->add_setting('homepage_first_banner', array( 'default' => '', 'sanitize_callback' => 'lifestyle_footer_options', )); $wp_customize->add_control('homepage_first_banner', array( 'label' => 'Homepage banner after second post', 'section' => 'homepage_settings_section', 'type' => 'textarea', )); //adding setting for footer text area $wp_customize->add_setting('homepage_second_banner', array( 'default' => '', 'sanitize_callback' => 'lifestyle_footer_options', )); $wp_customize->add_control('homepage_second_banner', array( 'label' => 'Homepage banner after fourth post', 'section' => 'homepage_settings_section', 'type' => 'textarea', )); /** * Sanitizes the footer content on the customize screen. Users with the 'unfiltered_html' cap can post * anything. For other users, wp_filter_post_kses() is ran over the setting. * @param mixed $setting The current setting passed to sanitize. * @param object $object The setting object passed via WP_Customize_Setting. * @return mixed $setting */ function lifestyle_footer_options( $setting, $object ) { /* Get the theme prefix. */ $prefix = 'authority'; /* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */ if ( "lifestyle_footer[footer_text]" == $object->id && !current_user_can( 'unfiltered_html' ) ) $setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) ); /* Return the sanitized setting and apply filters. */ return apply_filters( "{$prefix}_customize_sanitize", $setting, $object ); } } add_action( 'wp_head' , 'my_dynamic_css' ); function my_dynamic_css() { ?> < id="comment-">
'; echo ''; echo '
'; echo ''; echo ''; echo '
'; echo ''; echo ''; echo '
'; echo '