*/ /** * This function return a value of given theme option name from database. * * @since 1.0.0 * * @param string $option Theme option to return. * @return mixed The value of theme option. */ function gridpal_get_option($option) { $gridpal_options = get_option('gridpal_options'); if ((is_array($gridpal_options)) && (array_key_exists($option, $gridpal_options))) { return $gridpal_options[$option]; } else { return ''; } } function gridpal_is_option_set($option) { $gridpal_options = get_option('gridpal_options'); if ((is_array($gridpal_options)) && (array_key_exists($option, $gridpal_options))) { return true; } else { return false; } } if ( ! function_exists( 'gridpal_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function gridpal_setup() { global $wp_version; /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on GridPal, use a find and replace * to change 'gridpal' to the name of your theme in all the template files. */ load_theme_textdomain( 'gridpal', 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. * 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' ); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support( 'post-thumbnails' ); if ( function_exists( 'add_image_size' ) ) { add_image_size( 'gridpal-1218w-autoh-image', 1218, 9999, false ); add_image_size( 'gridpal-680w-autoh-image', 680, 9999, false ); add_image_size( 'gridpal-480w-autoh-image', 480, 9999, false ); } // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__('Primary Menu', 'gridpal'), 'secondary' => esc_html__('Secondary Menu', 'gridpal') ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ $markup = array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ); add_theme_support( 'html5', $markup ); add_theme_support( 'custom-logo', array( 'height' => 37, 'width' => 280, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); // Support for Custom Header add_theme_support( 'custom-header', apply_filters( 'gridpal_custom_header_args', array( 'default-image' => '', 'default-text-color' => 'ffffff', 'width' => 1920, 'height' => 400, 'flex-width' => true, 'flex-height' => true, 'wp-head-callback' => 'gridpal_header_style', 'uploads' => true, ) ) ); // Set up the WordPress core custom background feature. $background_args = array( 'default-color' => 'efefef', 'default-image' => get_template_directory_uri() .'/assets/images/background.jpg', 'default-repeat' => 'repeat', 'default-position-x' => 'left', 'default-position-y' => 'top', 'default-size' => 'auto', 'default-attachment' => 'fixed', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => 'admin_head_callback_func', 'admin-preview-callback' => 'admin_preview_callback_func', ); add_theme_support( 'custom-background', apply_filters( 'gridpal_custom_background_args', $background_args) ); // Support for Custom Editor Style add_editor_style( 'css/editor-style.css' ); } endif; add_action( 'after_setup_theme', 'gridpal_setup' ); /** * Layout Functions */ function gridpal_hide_footer_widgets() { $hide_footer_widgets = FALSE; if ( gridpal_get_option('hide_footer_widgets') ) { $hide_footer_widgets = TRUE; } return apply_filters( 'gridpal_hide_footer_widgets', $hide_footer_widgets ); } function gridpal_is_header_content_active() { $header_content_active = TRUE; if ( gridpal_get_option('hide_header_content') ) { $header_content_active = FALSE; } return apply_filters( 'gridpal_is_header_content_active', $header_content_active ); } function gridpal_is_primary_menu_active() { $primary_menu_active = TRUE; if ( gridpal_get_option('disable_primary_menu') ) { $primary_menu_active = FALSE; } return apply_filters( 'gridpal_is_primary_menu_active', $primary_menu_active ); } function gridpal_is_menu_social_bar_active() { $menu_social_bar_active = TRUE; if ( gridpal_get_option('disable_menu_social_bar') ) { $menu_social_bar_active = FALSE; } return apply_filters( 'gridpal_is_menu_social_bar_active', $menu_social_bar_active ); } function gridpal_is_secondary_menu_active() { $secondary_menu_active = TRUE; if ( gridpal_get_option('disable_secondary_menu') ) { $secondary_menu_active = FALSE; } return apply_filters( 'gridpal_is_secondary_menu_active', $secondary_menu_active ); } function gridpal_is_social_buttons_active() { $social_buttons_active = TRUE; if ( gridpal_get_option('hide_header_social_buttons') ) { $social_buttons_active = FALSE; } return apply_filters( 'gridpal_is_social_buttons_active', $social_buttons_active ); } function gridpal_is_fitvids_active() { $fitvids_active = TRUE; if ( gridpal_get_option('disable_fitvids') ) { $fitvids_active = FALSE; } return apply_filters( 'gridpal_is_fitvids_active', $fitvids_active ); } /** * 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 gridpal_content_width() { $content_width = 680; if ( is_page_template( array( 'template-full-width-page.php', 'template-full-width-post.php' ) ) ) { $content_width = 1218; } if ( is_404() ) { $content_width = 1218; } $GLOBALS['content_width'] = apply_filters( 'gridpal_content_width', $content_width ); /* phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedVariableFound */ } add_action( 'template_redirect', 'gridpal_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function gridpal_widgets_init() { register_sidebar(array( 'id' => 'gridpal-sidebar-one', 'name' => esc_html__( 'Sidebar 1 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located on the left-hand side of your web page.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-side-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-sidebar-two', 'name' => esc_html__( 'Sidebar 2 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located on the right-hand side of your web page.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-side-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-fullwidth-widgets', 'name' => esc_html__( 'Top Full Width Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This full-width widget area is located after the header of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-fullwidth-widgets', 'name' => esc_html__( 'Top Full Width Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This full-width widget area is located after the header of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-top-widgets', 'name' => esc_html__( 'Above Content Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the top of the main content (above posts) of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-top-widgets', 'name' => esc_html__( 'Above Content Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the top of the main content (above posts) of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-left-top-widgets', 'name' => esc_html__( 'Top Left Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the left top of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-left-top-widgets', 'name' => esc_html__( 'Top Left Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the left top of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-right-top-widgets', 'name' => esc_html__( 'Top Right Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the right top of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-right-top-widgets', 'name' => esc_html__( 'Top Right Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the right top of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-bottom-widgets', 'name' => esc_html__( 'Below Content Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the bottom of the main content (below posts) of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-bottom-widgets', 'name' => esc_html__( 'Below Content Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the bottom of the main content (below posts) of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-home-fullwidth-bottom-widgets', 'name' => esc_html__( 'Bottom Full Width Widgets (Default HomePage)', 'gridpal' ), 'description' => esc_html__( 'This full-width widget area is located before the footer of your website. Widgets of this widget area are displayed on the default homepage of your website (when you are showing your latest posts on homepage).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-fullwidth-bottom-widgets', 'name' => esc_html__( 'Bottom Full Width Widgets (Everywhere)', 'gridpal' ), 'description' => esc_html__( 'This full-width widget area is located before the footer of your website. Widgets of this widget area are displayed on every page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-single-post-bottom-widgets', 'name' => esc_html__( 'Single Post Bottom Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located at the bottom of single post of any post type (except attachments and pages).', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); register_sidebar(array( 'id' => 'gridpal-top-footer', 'name' => esc_html__( 'Footer Top Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located on the top of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-footer-1', 'name' => esc_html__( 'Footer 1 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is the column 1 of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-footer-2', 'name' => esc_html__( 'Footer 2 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is the column 2 of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-footer-3', 'name' => esc_html__( 'Footer 3 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is the column 3 of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-footer-4', 'name' => esc_html__( 'Footer 4 Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is the column 4 of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-bottom-footer', 'name' => esc_html__( 'Footer Bottom Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located on the bottom of the footer of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-footer-widget widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2>')); register_sidebar(array( 'id' => 'gridpal-404-widgets', 'name' => esc_html__( '404 Page Widgets', 'gridpal' ), 'description' => esc_html__( 'This widget area is located on the 404(not found) page of your website.', 'gridpal' ), 'before_widget' => '<div id="%1$s" class="gridpal-main-widget widget gridpal-widget-box %2$s"><div class="gridpal-widget-box-inside">', 'after_widget' => '</div></div>', 'before_title' => '<div class="gridpal-widget-header"><h2 class="gridpal-widget-title"><span class="gridpal-widget-title-inside">', 'after_title' => '</span></h2></div>')); } add_action( 'widgets_init', 'gridpal_widgets_init' ); function gridpal_sidebar_one_widgets() { dynamic_sidebar( 'gridpal-sidebar-one' ); } function gridpal_sidebar_two_widgets() { dynamic_sidebar( 'gridpal-sidebar-two' ); } function gridpal_top_wide_widgets() { ?> <?php if ( is_active_sidebar( 'gridpal-home-fullwidth-widgets' ) || is_active_sidebar( 'gridpal-fullwidth-widgets' ) ) : ?> <div class="gridpal-outer-wrapper"> <div class="gridpal-top-wrapper-outer gridpal-clearfix"> <div class="gridpal-featured-posts-area gridpal-top-wrapper gridpal-clearfix"> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-fullwidth-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-fullwidth-widgets' ); ?> </div> </div> </div> <?php endif; ?> <?php } function gridpal_top_widgets() { ?> <?php if ( is_active_sidebar( 'gridpal-home-top-widgets' ) || is_active_sidebar( 'gridpal-top-widgets' ) ) : ?> <div class="gridpal-featured-posts-area gridpal-featured-posts-area-top gridpal-clearfix"> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-top-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-top-widgets' ); ?> </div> <?php endif; ?> <?php } function gridpal_top_left_right_widgets() { ?> <div class="gridpal-left-right-wrapper gridpal-clearfix"> <?php if ( is_active_sidebar( 'gridpal-home-left-top-widgets' ) || is_active_sidebar( 'gridpal-left-top-widgets' ) ) : ?> <div class="gridpal-left-top-wrapper"> <div class="gridpal-featured-posts-area gridpal-featured-posts-area-top gridpal-clearfix"> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-left-top-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-left-top-widgets' ); ?> </div> </div> <?php endif; ?> <?php if ( is_active_sidebar( 'gridpal-home-right-top-widgets' ) || is_active_sidebar( 'gridpal-right-top-widgets' ) ) : ?> <div class="gridpal-right-top-wrapper"> <div class="gridpal-featured-posts-area gridpal-featured-posts-area-top gridpal-clearfix"> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-right-top-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-right-top-widgets' ); ?> </div> </div> <?php endif; ?> </div> <?php } function gridpal_bottom_widgets() { ?> <?php if ( is_active_sidebar( 'gridpal-home-bottom-widgets' ) || is_active_sidebar( 'gridpal-bottom-widgets' ) ) : ?> <div class='gridpal-featured-posts-area gridpal-featured-posts-area-bottom gridpal-clearfix'> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-bottom-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-bottom-widgets' ); ?> </div> <?php endif; ?> <?php } function gridpal_bottom_wide_widgets() { ?> <?php if ( is_active_sidebar( 'gridpal-home-fullwidth-bottom-widgets' ) || is_active_sidebar( 'gridpal-fullwidth-bottom-widgets' ) ) : ?> <div class="gridpal-outer-wrapper"> <div class="gridpal-bottom-wrapper-outer gridpal-clearfix"> <div class="gridpal-featured-posts-area gridpal-bottom-wrapper gridpal-clearfix"> <?php if ( is_front_page() && is_home() && !is_paged() ) { ?> <?php dynamic_sidebar( 'gridpal-home-fullwidth-bottom-widgets' ); ?> <?php } ?> <?php dynamic_sidebar( 'gridpal-fullwidth-bottom-widgets' ); ?> </div> </div> </div> <?php endif; ?> <?php } function gridpal_404_widgets() { ?> <?php if ( is_active_sidebar( 'gridpal-404-widgets' ) ) : ?> <div class="gridpal-featured-posts-area gridpal-featured-posts-area-top gridpal-clearfix"> <?php dynamic_sidebar( 'gridpal-404-widgets' ); ?> </div> <?php endif; ?> <?php } function gridpal_post_bottom_widgets() { if ( is_singular() ) { if ( is_active_sidebar( 'gridpal-single-post-bottom-widgets' ) ) : ?> <div class="gridpal-featured-posts-area gridpal-clearfix"> <?php dynamic_sidebar( 'gridpal-single-post-bottom-widgets' ); ?> </div> <?php endif; } } /** * Social buttons */ function gridpal_social_buttons() { ?> <div class='gridpal-header-social-icons'> <?php if ( gridpal_get_option('twitterlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('twitterlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-twitter" aria-label="<?php esc_attr_e('Twitter Button','gridpal'); ?>"><i class="fab fa-twitter" aria-hidden="true" title="<?php esc_attr_e('Twitter','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('facebooklink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('facebooklink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-facebook" aria-label="<?php esc_attr_e('Facebook Button','gridpal'); ?>"><i class="fab fa-facebook-f" aria-hidden="true" title="<?php esc_attr_e('Facebook','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('googlelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('googlelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-google-plus" aria-label="<?php esc_attr_e('Google Plus Button','gridpal'); ?>"><i class="fab fa-google-plus-g" aria-hidden="true" title="<?php esc_attr_e('Google Plus','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('pinterestlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('pinterestlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-pinterest" aria-label="<?php esc_attr_e('Pinterest Button','gridpal'); ?>"><i class="fab fa-pinterest" aria-hidden="true" title="<?php esc_attr_e('Pinterest','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('linkedinlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('linkedinlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-linkedin" aria-label="<?php esc_attr_e('Linkedin Button','gridpal'); ?>"><i class="fab fa-linkedin-in" aria-hidden="true" title="<?php esc_attr_e('Linkedin','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('instagramlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('instagramlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-instagram" aria-label="<?php esc_attr_e('Instagram Button','gridpal'); ?>"><i class="fab fa-instagram" aria-hidden="true" title="<?php esc_attr_e('Instagram','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('flickrlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('flickrlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-flickr" aria-label="<?php esc_attr_e('Flickr Button','gridpal'); ?>"><i class="fab fa-flickr" aria-hidden="true" title="<?php esc_attr_e('Flickr','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('youtubelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('youtubelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-youtube" aria-label="<?php esc_attr_e('Youtube Button','gridpal'); ?>"><i class="fab fa-youtube" aria-hidden="true" title="<?php esc_attr_e('Youtube','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('vimeolink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('vimeolink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-vimeo" aria-label="<?php esc_attr_e('Vimeo Button','gridpal'); ?>"><i class="fab fa-vimeo-v" aria-hidden="true" title="<?php esc_attr_e('Vimeo','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('soundcloudlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('soundcloudlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-soundcloud" aria-label="<?php esc_attr_e('SoundCloud Button','gridpal'); ?>"><i class="fab fa-soundcloud" aria-hidden="true" title="<?php esc_attr_e('SoundCloud','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('messengerlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('messengerlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-messenger" aria-label="<?php esc_attr_e('Messenger Button','gridpal'); ?>"><i class="fab fa-facebook-messenger" aria-hidden="true" title="<?php esc_attr_e('Messenger','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('whatsapplink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('whatsapplink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-whatsapp" aria-label="<?php esc_attr_e('WhatsApp Button','gridpal'); ?>"><i class="fab fa-whatsapp" aria-hidden="true" title="<?php esc_attr_e('WhatsApp','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('lastfmlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('lastfmlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-lastfm" aria-label="<?php esc_attr_e('Lastfm Button','gridpal'); ?>"><i class="fab fa-lastfm" aria-hidden="true" title="<?php esc_attr_e('Lastfm','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('mediumlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('mediumlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-medium" aria-label="<?php esc_attr_e('Medium Button','gridpal'); ?>"><i class="fab fa-medium-m" aria-hidden="true" title="<?php esc_attr_e('Medium','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('githublink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('githublink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-github" aria-label="<?php esc_attr_e('Github Button','gridpal'); ?>"><i class="fab fa-github" aria-hidden="true" title="<?php esc_attr_e('Github','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('bitbucketlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('bitbucketlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-bitbucket" aria-label="<?php esc_attr_e('Bitbucket Button','gridpal'); ?>"><i class="fab fa-bitbucket" aria-hidden="true" title="<?php esc_attr_e('Bitbucket','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('tumblrlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('tumblrlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-tumblr" aria-label="<?php esc_attr_e('Tumblr Button','gridpal'); ?>"><i class="fab fa-tumblr" aria-hidden="true" title="<?php esc_attr_e('Tumblr','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('digglink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('digglink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-digg" aria-label="<?php esc_attr_e('Digg Button','gridpal'); ?>"><i class="fab fa-digg" aria-hidden="true" title="<?php esc_attr_e('Digg','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('deliciouslink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('deliciouslink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-delicious" aria-label="<?php esc_attr_e('Delicious Button','gridpal'); ?>"><i class="fab fa-delicious" aria-hidden="true" title="<?php esc_attr_e('Delicious','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('stumblelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('stumblelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-stumbleupon" aria-label="<?php esc_attr_e('Stumbleupon Button','gridpal'); ?>"><i class="fab fa-stumbleupon" aria-hidden="true" title="<?php esc_attr_e('Stumbleupon','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('mixlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('mixlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-mix" aria-label="<?php esc_attr_e('Mix Button','gridpal'); ?>"><i class="fab fa-mix" aria-hidden="true" title="<?php esc_attr_e('Mix','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('redditlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('redditlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-reddit" aria-label="<?php esc_attr_e('Reddit Button','gridpal'); ?>"><i class="fab fa-reddit" aria-hidden="true" title="<?php esc_attr_e('Reddit','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('dribbblelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('dribbblelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-dribbble" aria-label="<?php esc_attr_e('Dribbble Button','gridpal'); ?>"><i class="fab fa-dribbble" aria-hidden="true" title="<?php esc_attr_e('Dribbble','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('flipboardlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('flipboardlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-flipboard" aria-label="<?php esc_attr_e('Flipboard Button','gridpal'); ?>"><i class="fab fa-flipboard" aria-hidden="true" title="<?php esc_attr_e('Flipboard','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('bloggerlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('bloggerlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-blogger" aria-label="<?php esc_attr_e('Blogger Button','gridpal'); ?>"><i class="fab fa-blogger" aria-hidden="true" title="<?php esc_attr_e('Blogger','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('etsylink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('etsylink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-etsy" aria-label="<?php esc_attr_e('Etsy Button','gridpal'); ?>"><i class="fab fa-etsy" aria-hidden="true" title="<?php esc_attr_e('Etsy','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('behancelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('behancelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-behance" aria-label="<?php esc_attr_e('Behance Button','gridpal'); ?>"><i class="fab fa-behance" aria-hidden="true" title="<?php esc_attr_e('Behance','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('amazonlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('amazonlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-amazon" aria-label="<?php esc_attr_e('Amazon Button','gridpal'); ?>"><i class="fab fa-amazon" aria-hidden="true" title="<?php esc_attr_e('Amazon','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('meetuplink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('meetuplink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-meetup" aria-label="<?php esc_attr_e('Meetup Button','gridpal'); ?>"><i class="fab fa-meetup" aria-hidden="true" title="<?php esc_attr_e('Meetup','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('mixcloudlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('mixcloudlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-mixcloud" aria-label="<?php esc_attr_e('Mixcloud Button','gridpal'); ?>"><i class="fab fa-mixcloud" aria-hidden="true" title="<?php esc_attr_e('Mixcloud','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('slacklink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('slacklink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-slack" aria-label="<?php esc_attr_e('Slack Button','gridpal'); ?>"><i class="fab fa-slack" aria-hidden="true" title="<?php esc_attr_e('Slack','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('snapchatlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('snapchatlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-snapchat" aria-label="<?php esc_attr_e('Snapchat Button','gridpal'); ?>"><i class="fab fa-snapchat" aria-hidden="true" title="<?php esc_attr_e('Snapchat','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('spotifylink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('spotifylink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-spotify" aria-label="<?php esc_attr_e('Spotify Button','gridpal'); ?>"><i class="fab fa-spotify" aria-hidden="true" title="<?php esc_attr_e('Spotify','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('yelplink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('yelplink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-yelp" aria-label="<?php esc_attr_e('Yelp Button','gridpal'); ?>"><i class="fab fa-yelp" aria-hidden="true" title="<?php esc_attr_e('Yelp','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('wordpresslink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('wordpresslink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-wordpress" aria-label="<?php esc_attr_e('WordPress Button','gridpal'); ?>"><i class="fab fa-wordpress" aria-hidden="true" title="<?php esc_attr_e('WordPress','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('twitchlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('twitchlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-twitch" aria-label="<?php esc_attr_e('Twitch Button','gridpal'); ?>"><i class="fab fa-twitch" aria-hidden="true" title="<?php esc_attr_e('Twitch','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('telegramlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('telegramlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-telegram" aria-label="<?php esc_attr_e('Telegram Button','gridpal'); ?>"><i class="fab fa-telegram" aria-hidden="true" title="<?php esc_attr_e('Telegram','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('bandcamplink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('bandcamplink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-bandcamp" aria-label="<?php esc_attr_e('Bandcamp Button','gridpal'); ?>"><i class="fab fa-bandcamp" aria-hidden="true" title="<?php esc_attr_e('Bandcamp','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('quoralink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('quoralink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-quora" aria-label="<?php esc_attr_e('Quora Button','gridpal'); ?>"><i class="fab fa-quora" aria-hidden="true" title="<?php esc_attr_e('Quora','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('foursquarelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('foursquarelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-foursquare" aria-label="<?php esc_attr_e('Foursquare Button','gridpal'); ?>"><i class="fab fa-foursquare" aria-hidden="true" title="<?php esc_attr_e('Foursquare','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('deviantartlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('deviantartlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-deviantart" aria-label="<?php esc_attr_e('DeviantArt Button','gridpal'); ?>"><i class="fab fa-deviantart" aria-hidden="true" title="<?php esc_attr_e('DeviantArt','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('imdblink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('imdblink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-imdb" aria-label="<?php esc_attr_e('IMDB Button','gridpal'); ?>"><i class="fab fa-imdb" aria-hidden="true" title="<?php esc_attr_e('IMDB','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('vklink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('vklink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-vk" aria-label="<?php esc_attr_e('VK Button','gridpal'); ?>"><i class="fab fa-vk" aria-hidden="true" title="<?php esc_attr_e('VK','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('codepenlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('codepenlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-codepen" aria-label="<?php esc_attr_e('Codepen Button','gridpal'); ?>"><i class="fab fa-codepen" aria-hidden="true" title="<?php esc_attr_e('Codepen','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('jsfiddlelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('jsfiddlelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-jsfiddle" aria-label="<?php esc_attr_e('JSFiddle Button','gridpal'); ?>"><i class="fab fa-jsfiddle" aria-hidden="true" title="<?php esc_attr_e('JSFiddle','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('stackoverflowlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('stackoverflowlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-stackoverflow" aria-label="<?php esc_attr_e('Stack Overflow Button','gridpal'); ?>"><i class="fab fa-stack-overflow" aria-hidden="true" title="<?php esc_attr_e('Stack Overflow','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('stackexchangelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('stackexchangelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-stackexchange" aria-label="<?php esc_attr_e('Stack Exchange Button','gridpal'); ?>"><i class="fab fa-stack-exchange" aria-hidden="true" title="<?php esc_attr_e('Stack Exchange','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('bsalink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('bsalink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-buysellads" aria-label="<?php esc_attr_e('BuySellAds Button','gridpal'); ?>"><i class="fab fa-buysellads" aria-hidden="true" title="<?php esc_attr_e('BuySellAds','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('web500pxlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('web500pxlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-web500px" aria-label="<?php esc_attr_e('500px Button','gridpal'); ?>"><i class="fab fa-500px" aria-hidden="true" title="<?php esc_attr_e('500px','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('ellolink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('ellolink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-ello" aria-label="<?php esc_attr_e('Ello Button','gridpal'); ?>"><i class="fab fa-ello" aria-hidden="true" title="<?php esc_attr_e('Ello','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('discordlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('discordlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-discord" aria-label="<?php esc_attr_e('Discord Button','gridpal'); ?>"><i class="fab fa-discord" aria-hidden="true" title="<?php esc_attr_e('Discord','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('goodreadslink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('goodreadslink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-goodreads" aria-label="<?php esc_attr_e('Goodreads Button','gridpal'); ?>"><i class="fab fa-goodreads" aria-hidden="true" title="<?php esc_attr_e('Goodreads','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('odnoklassnikilink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('odnoklassnikilink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-odnoklassniki" aria-label="<?php esc_attr_e('Odnoklassniki Button','gridpal'); ?>"><i class="fab fa-odnoklassniki" aria-hidden="true" title="<?php esc_attr_e('Odnoklassniki','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('houzzlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('houzzlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-houzz" aria-label="<?php esc_attr_e('Houzz Button','gridpal'); ?>"><i class="fab fa-houzz" aria-hidden="true" title="<?php esc_attr_e('Houzz','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('pocketlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('pocketlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-pocket" aria-label="<?php esc_attr_e('Pocket Button','gridpal'); ?>"><i class="fab fa-get-pocket" aria-hidden="true" title="<?php esc_attr_e('Pocket','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('xinglink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('xinglink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-xing" aria-label="<?php esc_attr_e('XING Button','gridpal'); ?>"><i class="fab fa-xing" aria-hidden="true" title="<?php esc_attr_e('XING','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('googleplaylink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('googleplaylink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-googleplay" aria-label="<?php esc_attr_e('Google Play Button','gridpal'); ?>"><i class="fab fa-google-play" aria-hidden="true" title="<?php esc_attr_e('Google Play','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('slidesharelink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('slidesharelink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-slideshare" aria-label="<?php esc_attr_e('SlideShare Button','gridpal'); ?>"><i class="fab fa-slideshare" aria-hidden="true" title="<?php esc_attr_e('SlideShare','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('dropboxlink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('dropboxlink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-dropbox" aria-label="<?php esc_attr_e('Dropbox Button','gridpal'); ?>"><i class="fab fa-dropbox" aria-hidden="true" title="<?php esc_attr_e('Dropbox','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('paypallink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('paypallink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-paypal" aria-label="<?php esc_attr_e('PayPal Button','gridpal'); ?>"><i class="fab fa-paypal" aria-hidden="true" title="<?php esc_attr_e('PayPal','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('viadeolink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('viadeolink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-viadeo" aria-label="<?php esc_attr_e('Viadeo Button','gridpal'); ?>"><i class="fab fa-viadeo" aria-hidden="true" title="<?php esc_attr_e('Viadeo','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('wikipedialink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('wikipedialink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-wikipedia" aria-label="<?php esc_attr_e('Wikipedia Button','gridpal'); ?>"><i class="fab fa-wikipedia-w" aria-hidden="true" title="<?php esc_attr_e('Wikipedia','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('skypeusername') ) : ?> <a href="skype:<?php echo esc_html( gridpal_get_option('skypeusername') ); ?>?chat" class="gridpal-header-social-icon-skype" aria-label="<?php esc_attr_e('Skype Button','gridpal'); ?>"><i class="fab fa-skype" aria-hidden="true" title="<?php esc_attr_e('Skype','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('emailaddress') ) : ?> <a href="mailto:<?php echo esc_html( gridpal_get_option('emailaddress') ); ?>" class="gridpal-header-social-icon-email" aria-label="<?php esc_attr_e('Email Us Button','gridpal'); ?>"><i class="far fa-envelope" aria-hidden="true" title="<?php esc_attr_e('Email Us','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('rsslink') ) : ?> <a href="<?php echo esc_url( gridpal_get_option('rsslink') ); ?>" target="_blank" rel="nofollow" class="gridpal-header-social-icon-rss" aria-label="<?php esc_attr_e('RSS Button','gridpal'); ?>"><i class="fas fa-rss" aria-hidden="true" title="<?php esc_attr_e('RSS','gridpal'); ?>"></i></a><?php endif; ?> <?php if ( gridpal_get_option('show_login_button') ) { ?><?php if (is_user_logged_in()) : ?><a href="<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>" aria-label="<?php esc_attr_e( 'Logout Button', 'gridpal' ); ?>" class="gridpal-header-social-icon-login"><i class="fas fa-sign-out-alt" aria-hidden="true" title="<?php esc_attr_e('Logout','gridpal'); ?>"></i></a><?php else : ?><a href="<?php echo esc_url( wp_login_url( get_permalink() ) ); ?>" aria-label="<?php esc_attr_e( 'Login / Register Button', 'gridpal' ); ?>" class="gridpal-header-social-icon-login"><i class="fas fa-sign-in-alt" aria-hidden="true" title="<?php esc_attr_e('Login / Register','gridpal'); ?>"></i></a><?php endif;?><?php } ?> <?php if ( !(gridpal_get_option('hide_search_button')) ) { ?><a href="<?php echo esc_url( '#' ); ?>" class="gridpal-header-social-icon-search" aria-label="<?php esc_attr_e('Search Button','gridpal'); ?>"><i class="fas fa-search" aria-hidden="true" title="<?php esc_attr_e('Search','gridpal'); ?>"></i></a><?php } ?> </div> <?php } /** * Author bio box */ function gridpal_add_author_bio_box() { $content=''; if (is_single()) { $content .= ' <div class="gridpal-author-bio"> <div class="gridpal-author-bio-inside"> <div class="gridpal-author-bio-top"> <span class="gridpal-author-bio-gravatar"> '. get_avatar( get_the_author_meta('email') , 80 ) .' </span> <div class="gridpal-author-bio-text"> <div class="gridpal-author-bio-name">'.esc_html__( 'Author: ', 'gridpal' ).'<span>'. get_the_author_link() .'</span></div><div class="gridpal-author-bio-text-description">'. wp_kses_post( get_the_author_meta('description',get_query_var('author') ) ) .'</div> </div> </div> </div> </div> '; } return apply_filters( 'gridpal_add_author_bio_box', $content ); } /** * Post meta functions */ function gridpal_post_cat_links_text() { if ( gridpal_is_option_set('cat_links_text') ) { $cat_links_text = gridpal_get_option('cat_links_text'); } else { $cat_links_text = esc_html__( 'Posted in', 'gridpal' ); } return apply_filters( 'gridpal_post_cat_links_text', $cat_links_text ); } function gridpal_post_tag_links_text() { if ( gridpal_is_option_set('tag_links_text') ) { $tag_links_text = gridpal_get_option('tag_links_text'); } else { $tag_links_text = esc_html__( 'Tagged', 'gridpal' ); } return apply_filters( 'gridpal_post_tag_links_text', $tag_links_text ); } if ( ! function_exists( 'gridpal_post_tags' ) ) : /** * Prints HTML with meta information for the tags. */ function gridpal_post_tags() { if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'gridpal' ) ); if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '<span class="gridpal-tags-links"><i class="fas fa-tags" aria-hidden="true"></i> ' . esc_html__( 'Tagged %1$s', 'gridpal' ) . '</span>', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } endif; if ( ! function_exists( 'gridpal_grid_cats' ) ) : function gridpal_grid_cats() { if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space */ $categories_list = get_the_category_list( esc_html__( ' ', 'gridpal' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '<div class="gridpal-grid-post-categories">' . __( '<span class="gridpal-sr-only">Posted in </span>%1$s', 'gridpal' ) . '</div>', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } endif; function gridpal_author_image_size() { global $post; $gravatar_size = 36; return apply_filters( 'gridpal_author_image_size', $gravatar_size ); } if ( ! function_exists( 'gridpal_author_image' ) ) : function gridpal_author_image( $size = '' ) { global $post; if ( $size ) { $gravatar_size = $size; } else { $gravatar_size = gridpal_author_image_size(); } $author_email = get_the_author_meta( 'user_email' ); $gravatar_args = apply_filters( 'gridpal_gravatar_args', array( 'size' => $gravatar_size, ) ); $avatar_url = ''; if( get_the_author_meta('themesdna_userprofile_image',get_query_var('author') ) ) { $avatar_url = get_the_author_meta( 'themesdna_userprofile_image' ); } else { $avatar_url = get_avatar_url( $author_email, $gravatar_args ); } //$avatar_url = get_avatar_url( $author_email, $gravatar_args ); if ( gridpal_get_option('author_image_link') ) { $avatar_markup = '<a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ).'" title="'.esc_attr( get_the_author() ).'"><img class="gridpal-grid-post-author-image" alt="' . esc_attr( get_the_author() ) . '" src="' . esc_url( $avatar_url ) . '" /></a>'; } else { $avatar_markup = '<img class="gridpal-grid-post-author-image" alt="' . esc_attr( get_the_author() ) . '" src="' . esc_url( $avatar_url ) . '" />'; } return apply_filters( 'gridpal_author_image', $avatar_markup ); } endif; if ( ! function_exists( 'gridpal_grid_header_meta' ) ) : function gridpal_grid_header_meta() { ?> <?php global $post; ?> <?php if ( !(gridpal_get_option('hide_post_author_home')) || !(gridpal_get_option('hide_comments_link_home')) ) { ?> <div class="gridpal-grid-header-meta gridpal-grid-post-block"> <div class="gridpal-grid-header-meta-inside"> <?php if ( !(gridpal_get_option('hide_post_author_home')) ) { ?><span class="gridpal-grid-post-author gridpal-grid-post-meta"><i class="far fa-user" aria-hidden="true"></i><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a></span><?php } ?> <?php if ( gridpal_get_option('comments_count_home') ) { ?> <?php if ( !(gridpal_get_option('hide_comments_link_home')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?> <span class="gridpal-grid-post-comment-count gridpal-grid-post-meta"><i class="far fa-comments" aria-hidden="true"></i><?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( '0<span class="gridpal-sr-only"> Comment on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), sprintf( wp_kses( /* translators: %s: post title */ __( '1<span class="gridpal-sr-only"> Comment on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), sprintf( wp_kses( /* translators: %s: post title */ __( '%1$s<span class="gridpal-sr-only"> Comments on %2$s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), number_format_i18n( get_comments_number() ), wp_kses_post( get_the_title() ) ) ); ?></span> <?php } ?><?php } ?> <?php } else { ?> <?php if ( !(gridpal_get_option('hide_comments_link_home')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?> <span class="gridpal-grid-post-comment gridpal-grid-post-meta"><i class="far fa-comments" aria-hidden="true"></i><?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( '0 Comment<span class="gridpal-sr-only"> on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); ?></span> <?php } ?><?php } ?> <?php } ?> </div> </div> <?php } ?> <?php } endif; if ( ! function_exists( 'gridpal_grid_footer_meta' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function gridpal_grid_footer_meta() { global $post; ?> <?php if ( (!(gridpal_get_option('hide_post_categories_home')) && has_category()) || (!(gridpal_get_option('hide_post_tags_home')) && has_tag()) ) { ?> <div class="gridpal-grid-footer-meta gridpal-grid-post-block"> <div class="gridpal-grid-footer-meta-inside"> <?php if ( !(gridpal_get_option('hide_post_categories_home')) && has_category() ) { if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'gridpal' ) ); if ( $categories_list ) { ?> <span class="gridpal-summary-post-cat-links gridpal-grid-footer-meta-block"><i class="far fa-folder-open" aria-hidden="true"></i><?php echo wp_kses_post( $categories_list ); ?></span> <?php } } } if ( !(gridpal_get_option('hide_post_tags_home')) && has_tag() ) { if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'gridpal' ) ); if ( $tags_list ) { ?> <span class="gridpal-summary-post-tags-links gridpal-grid-footer-meta-block"><i class="fas fa-tags" aria-hidden="true"></i><?php echo wp_kses_post( $tags_list ); ?></span> <?php } } } ?> </div> </div> <?php } ?> <?php } endif; if ( ! function_exists( 'gridpal_nongrid_postmeta' ) ) : function gridpal_nongrid_postmeta() { ?> <?php global $post; ?> <?php if ( !(gridpal_get_option('hide_post_author_home')) || !(gridpal_get_option('hide_posted_date_home')) || !(gridpal_get_option('hide_comments_link_home')) || !(gridpal_get_option('hide_post_categories_home')) ) { ?> <div class="gridpal-entry-meta-single"> <?php if ( !(gridpal_get_option('hide_post_author_home')) ) { ?><span class="gridpal-entry-meta-single-author"><i class="far fa-user-circle" aria-hidden="true"></i> <span class="author vcard" itemscope="itemscope" itemtype="http://schema.org/Person" itemprop="author"><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span><?php } ?> <?php if ( !(gridpal_get_option('hide_posted_date_home')) ) { ?><span class="gridpal-entry-meta-single-date"><i class="far fa-clock" aria-hidden="true"></i> <?php echo esc_html( get_the_date() ); ?></span><?php } ?> <?php if ( !(gridpal_get_option('hide_comments_link_home')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?> <span class="gridpal-entry-meta-single-comments"><i class="far fa-comments" aria-hidden="true"></i> <?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment<span class="gridpal-sr-only"> on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); ?></span> <?php } ?><?php } ?> <?php if ( !(gridpal_get_option('hide_post_categories_home')) ) { ?><?php gridpal_single_cats(); ?><?php } ?> </div> <?php } ?> <?php } endif; if ( ! function_exists( 'gridpal_single_cats' ) ) : function gridpal_single_cats() { if ( 'post' == get_post_type() ) { /* translators: used between list items, there is a space */ $categories_list = get_the_category_list( esc_html__( ', ', 'gridpal' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '<span class="gridpal-entry-meta-single-cats"><i class="far fa-folder-open" aria-hidden="true"></i> ' . __( '<span class="gridpal-sr-only">Posted in </span>%1$s', 'gridpal' ) . '</span>', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } endif; if ( ! function_exists( 'gridpal_single_postmeta' ) ) : function gridpal_single_postmeta() { ?> <?php global $post; ?> <?php if ( !(gridpal_get_option('hide_post_author')) || !(gridpal_get_option('hide_posted_date')) || !(gridpal_get_option('hide_comments_link')) || !(gridpal_get_option('hide_post_categories')) || !(gridpal_get_option('hide_post_edit')) ) { ?> <div class="gridpal-entry-meta-single"> <?php if ( !(gridpal_get_option('hide_post_author')) ) { ?><span class="gridpal-entry-meta-single-author"><i class="far fa-user-circle" aria-hidden="true"></i> <span class="author vcard" itemscope="itemscope" itemtype="http://schema.org/Person" itemprop="author"><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span><?php } ?> <?php if ( !(gridpal_get_option('hide_posted_date')) ) { ?><span class="gridpal-entry-meta-single-date"><i class="far fa-clock" aria-hidden="true"></i> <?php echo esc_html( get_the_date() ); ?></span><?php } ?> <?php if ( !(gridpal_get_option('hide_comments_link')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?> <span class="gridpal-entry-meta-single-comments"><i class="far fa-comments" aria-hidden="true"></i> <?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment<span class="gridpal-sr-only"> on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); ?></span> <?php } ?><?php } ?> <?php if ( !(gridpal_get_option('hide_post_categories')) ) { ?><?php gridpal_single_cats(); ?><?php } ?> <?php if ( !(gridpal_get_option('hide_post_edit')) ) { ?><?php edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit<span class="gridpal-sr-only"> %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ), '<span class="edit-link">  <i class="far fa-edit" aria-hidden="true"></i> ', '</span>' ); ?><?php } ?> </div> <?php } ?> <?php } endif; if ( ! function_exists( 'gridpal_page_postmeta' ) ) : function gridpal_page_postmeta() { ?> <?php global $post; ?> <?php if ( !(gridpal_get_option('hide_page_author')) || !(gridpal_get_option('hide_page_date')) || !(gridpal_get_option('hide_page_comments')) ) { ?> <div class="gridpal-entry-meta-single"> <?php if ( !(gridpal_get_option('hide_page_author')) ) { ?><span class="gridpal-entry-meta-single-author"><i class="far fa-user-circle" aria-hidden="true"></i> <span class="author vcard" itemscope="itemscope" itemtype="http://schema.org/Person" itemprop="author"><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php echo esc_html( get_the_author() ); ?></a></span></span><?php } ?> <?php if ( !(gridpal_get_option('hide_page_date')) ) { ?><span class="gridpal-entry-meta-single-date"><i class="far fa-clock" aria-hidden="true"></i> <?php echo esc_html( get_the_date() ); ?></span><?php } ?> <?php if ( !(gridpal_get_option('hide_page_comments')) ) { ?><?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { ?> <span class="gridpal-entry-meta-single-comments"><i class="far fa-comments" aria-hidden="true"></i> <?php comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment<span class="gridpal-sr-only"> on %s</span>', 'gridpal' ), array( 'span' => array( 'class' => array(), ), ) ), wp_kses_post( get_the_title() ) ) ); ?></span> <?php } ?><?php } ?> </div> <?php } ?> <?php } endif; if ( ! function_exists( 'gridpal_grid_datebox' ) ) : function gridpal_grid_datebox() { ?> <?php global $post; ?> <?php if ( !(gridpal_get_option('hide_posted_date_home')) ) { ?> <div class="gridpal-grid-datebox"><div class="gridpal-grid-datebox-inside"><div class="gridpal-grid-datebox-day"><?php echo esc_html( get_the_date('d') ); ?></div><div class="gridpal-grid-datebox-month"><?php echo esc_html( get_the_date('M') ); ?></div><?php if ( !(gridpal_get_option('hide_posted_date_year_home')) ) { ?><div class="gridpal-grid-datebox-year"><?php echo esc_html( get_the_date('Y') ); ?></div><?php } ?></div></div> <?php } ?> <?php } endif; /** * Posts navigation functions */ if ( ! function_exists( 'gridpal_wp_pagenavi' ) ) : function gridpal_wp_pagenavi() { ?> <nav class="navigation posts-navigation gridpal-clearfix" role="navigation"> <?php wp_pagenavi(); ?> </nav><!-- .navigation --> <?php } endif; if ( ! function_exists( 'gridpal_posts_navigation' ) ) : function gridpal_posts_navigation() { if ( !(gridpal_get_option('hide_posts_navigation')) ) { if ( function_exists( 'wp_pagenavi' ) ) { gridpal_wp_pagenavi(); } else { if ( gridpal_get_option('posts_navigation_type') === 'normalnavi' ) { the_posts_navigation(array('prev_text' => esc_html__( 'Older posts', 'gridpal' ), 'next_text' => esc_html__( 'Newer posts', 'gridpal' ))); } else { the_posts_pagination(array('mid_size' => 2, 'prev_text' => esc_html__( '← Newer posts', 'gridpal' ), 'next_text' => esc_html__( 'Older posts →', 'gridpal' ))); } } } } endif; if ( ! function_exists( 'gridpal_post_navigation' ) ) : function gridpal_post_navigation() { global $post; if ( !(gridpal_get_option('hide_post_navigation')) ) { the_post_navigation(array('prev_text' => esc_html__( '%title →', 'gridpal' ), 'next_text' => esc_html__( '← %title', 'gridpal' ))); } } endif; /** * Menu Functions */ // Get our wp_nav_menu() fallback, wp_page_menu(), to show a "Home" link as the first item function gridpal_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'gridpal_page_menu_args' ); function gridpal_primary_menu_text() { $menu_text = esc_html__( 'Menu', 'gridpal' ); if ( gridpal_get_option('primary_menu_text') ) { $menu_text = gridpal_get_option('primary_menu_text'); } return apply_filters( 'gridpal_primary_menu_text', $menu_text ); } function gridpal_secondary_menu_text() { $menu_text = esc_html__( 'Menu', 'gridpal' ); if ( gridpal_get_option('secondary_menu_text') ) { $menu_text = gridpal_get_option('secondary_menu_text'); } return apply_filters( 'gridpal_secondary_menu_text', $menu_text ); } function gridpal_top_fallback_menu() { wp_page_menu( array( 'sort_column' => 'menu_order, post_title', 'menu_id' => 'gridpal-menu-secondary-navigation', 'menu_class' => 'gridpal-secondary-nav-menu gridpal-menu-secondary', 'container' => 'ul', 'echo' => true, 'link_before' => '', 'link_after' => '', 'before' => '', 'after' => '', 'item_spacing' => 'discard', 'walker' => '', ) ); } function gridpal_fallback_menu() { wp_page_menu( array( 'sort_column' => 'menu_order, post_title', 'menu_id' => 'gridpal-menu-primary-navigation', 'menu_class' => 'gridpal-primary-nav-menu gridpal-menu-primary', 'container' => 'ul', 'echo' => true, 'link_before' => '', 'link_after' => '', 'before' => '', 'after' => '', 'item_spacing' => 'discard', 'walker' => '', ) ); } function gridpal_secondary_menu_area() { if ( gridpal_is_menu_social_bar_active() ) { ?> <div class="gridpal-container gridpal-secondary-menu-container gridpal-clearfix"> <div class="gridpal-secondary-menu-container-inside gridpal-clearfix"> <nav class="gridpal-nav-secondary" id="gridpal-secondary-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement" role="navigation" aria-label="<?php esc_attr_e( 'Secondary Menu', 'gridpal' ); ?>"> <div class="gridpal-outer-wrapper"> <?php if ( gridpal_is_secondary_menu_active() ) { ?> <button class="gridpal-secondary-responsive-menu-icon" aria-controls="gridpal-menu-secondary-navigation" aria-expanded="false"><?php echo esc_html( gridpal_secondary_menu_text() ); ?></button> <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'menu_id' => 'gridpal-menu-secondary-navigation', 'menu_class' => 'gridpal-secondary-nav-menu gridpal-menu-secondary', 'fallback_cb' => 'gridpal_top_fallback_menu', 'container' => '', ) ); ?> <?php } ?> <?php if ( gridpal_is_social_buttons_active() ) { ?> <?php gridpal_social_buttons(); ?> <?php if ( !(gridpal_get_option('hide_search_button')) ) { ?> <div id="gridpal-search-overlay-wrap" class="gridpal-search-overlay"> <div class="gridpal-search-overlay-content"> <?php get_search_form(); ?> </div> <button class="gridpal-search-closebtn" aria-label="<?php esc_attr_e( 'Close Search', 'gridpal' ); ?>" title="<?php esc_attr_e('Close Search','gridpal'); ?>">×</button> </div> <?php } ?> <?php } ?> </div> </nav> </div> </div> <?php } } /** * Header Functions */ /** * Add a pingback url auto-discovery header for single posts, pages, or attachments. */ function gridpal_pingback_header() { if ( is_singular() && pings_open() ) { echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">'; } } add_action( 'wp_head', 'gridpal_pingback_header' ); // Get custom-logo URL function gridpal_custom_logo() { if ( ! has_custom_logo() ) {return;} $gridpal_custom_logo_id = get_theme_mod( 'custom_logo' ); $gridpal_logo = wp_get_attachment_image_src( $gridpal_custom_logo_id , 'full' ); $gridpal_logo_src = $gridpal_logo[0]; return apply_filters( 'gridpal_custom_logo', $gridpal_logo_src ); } // Site Title function gridpal_site_title() { if ( is_front_page() && is_home() ) { ?> <h1 class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_home() ) { ?> <h1 class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_singular() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_category() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_tag() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_author() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_archive() && !is_category() && !is_tag() && !is_author() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_search() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } elseif ( is_404() ) { ?> <p class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } else { ?> <h1 class="gridpal-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> <?php if ( !(gridpal_get_option('hide_tagline')) ) { ?><p class="gridpal-site-description"><?php bloginfo( 'description' ); ?></p><?php } ?> <?php } } function gridpal_header_image_destination() { $url = home_url( '/' ); if ( gridpal_get_option('header_image_destination') ) { $url = gridpal_get_option('header_image_destination'); } return apply_filters( 'gridpal_header_image_destination', $url ); } function gridpal_header_image_markup() { if ( get_header_image() ) { if ( gridpal_get_option('remove_header_image_link') ) { the_header_image_tag( array( 'class' => 'gridpal-header-img', 'alt' => '' ) ); } else { ?> <a href="<?php echo esc_url( gridpal_header_image_destination() ); ?>" rel="home" class="gridpal-header-img-link"><?php the_header_image_tag( array( 'class' => 'gridpal-header-img', 'alt' => '' ) ); ?></a> <?php } } } function gridpal_header_image_details() { $header_image_custom_title = ''; if ( gridpal_get_option('header_image_custom_title') ) { $header_image_custom_title = gridpal_get_option('header_image_custom_title'); } $header_image_custom_description = ''; if ( gridpal_get_option('header_image_custom_description') ) { $header_image_custom_description = gridpal_get_option('header_image_custom_description'); } if ( !(gridpal_get_option('hide_header_image_details')) ) { if ( gridpal_get_option('header_image_custom_text') ) { if ( $header_image_custom_title || $header_image_custom_description ) { ?> <div class="gridpal-header-image-info"> <div class="gridpal-header-image-info-inside"> <?php if ( $header_image_custom_title ) { ?><p class="gridpal-header-image-site-title gridpal-header-image-block"><?php echo wp_kses_post( force_balance_tags( do_shortcode($header_image_custom_title) ) ); ?></p><?php } ?> <?php if ( !(gridpal_get_option('hide_header_image_description')) ) { ?><?php if ( $header_image_custom_description ) { ?><p class="gridpal-header-image-site-description gridpal-header-image-block"><?php echo wp_kses_post( force_balance_tags( do_shortcode($header_image_custom_description) ) ); ?></p><?php } ?><?php } ?> </div> </div> <?php } } else { ?> <div class="gridpal-header-image-info"> <div class="gridpal-header-image-info-inside"> <p class="gridpal-header-image-site-title gridpal-header-image-block"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p> <?php if ( !(gridpal_get_option('hide_header_image_description')) ) { ?><p class="gridpal-header-image-site-description gridpal-header-image-block"><?php bloginfo( 'description' ); ?></p><?php } ?> </div> </div> <?php } } } function gridpal_header_image_wrapper() { ?><div class="gridpal-header-image gridpal-clearfix"> <?php gridpal_header_image_markup(); ?> <?php gridpal_header_image_details(); ?> </div><?php } function gridpal_header_image() { if ( gridpal_get_option('hide_header_image') ) { return; } if ( get_header_image() ) { gridpal_header_image_wrapper(); } } /** * Css Classes Functions */ // Category ids in post class function gridpal_category_id_class($classes) { global $post; foreach((get_the_category($post->ID)) as $category) { $classes[] = 'wpcat-' . $category->cat_ID . '-id'; } return apply_filters( 'gridpal_category_id_class', $classes ); } add_filter('post_class', 'gridpal_category_id_class'); // Adds custom classes to the array of body classes. function gridpal_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'gridpal-group-blog'; } if ( !(gridpal_get_option('disable_loading_animation')) ) { $classes[] = 'gridpal-animated gridpal-fadein'; } $classes[] = 'gridpal-theme-is-active'; if ( get_header_image() ) { $classes[] = 'gridpal-header-image-active'; } if ( has_custom_logo() ) { $classes[] = 'gridpal-custom-logo-active'; } $classes[] = 'gridpal-layout-type-full'; $classes[] = 'gridpal-masonry-active'; $classes[] = 'gridpal-float-grid'; if ( !(is_singular()) ) { if ( gridpal_get_option('featured_nongrid_media_under_post_title') ) { $classes[] = 'gridpal-nongrid-media-under-title'; } } if( is_single() ) { if ( gridpal_get_option('featured_media_under_post_title') ) { $classes[] = 'gridpal-single-media-under-title'; } } if( is_page() ) { if ( gridpal_get_option('featured_media_under_page_title') ) { $classes[] = 'gridpal-single-media-under-title'; } } if ( is_page_template( array( 'template-full-width-page.php', 'template-full-width-post.php' ) ) ) { $classes[] = 'gridpal-layout-full-width'; } if ( is_404() ) { $classes[] = 'gridpal-layout-full-width'; } if ( !(gridpal_is_primary_menu_active()) ) { $classes[] = 'gridpal-header-full-active'; } else { $classes[] = 'gridpal-header-menu-active'; } if ( gridpal_get_option('hide_tagline') ) { $classes[] = 'gridpal-tagline-inactive'; } if ( gridpal_is_primary_menu_active() ) { $classes[] = 'gridpal-primary-menu-active'; } else { $classes[] = 'gridpal-primary-menu-inactive'; } $classes[] = 'gridpal-primary-mobile-menu-active'; if ( gridpal_is_secondary_menu_active() ) { $classes[] = 'gridpal-secondary-menu-active'; } else { $classes[] = 'gridpal-secondary-menu-inactive'; } $classes[] = 'gridpal-secondary-mobile-menu-active'; $classes[] = 'gridpal-secondary-menu-before-header'; if ( gridpal_is_social_buttons_active() ) { $classes[] = 'gridpal-social-buttons-active'; } else { $classes[] = 'gridpal-social-buttons-inactive'; } if ( gridpal_get_option('hide_posted_date_year_home') ) { $classes[] = 'gridpal-small-datebox'; } if ( gridpal_get_option('date_box_style') == 'square' ) { $classes[] = 'gridpal-square-datebox'; } else { $classes[] = 'gridpal-round-datebox'; } return apply_filters( 'gridpal_body_classes', $classes ); } add_filter( 'body_class', 'gridpal_body_classes' ); /** * More Custom Functions */ // Change excerpt length function gridpal_excerpt_length($length) { if ( is_admin() ) { return $length; } $read_more_length = 17; if ( gridpal_get_option('read_more_length') ) { $read_more_length = gridpal_get_option('read_more_length'); } return apply_filters( 'gridpal_excerpt_length', $read_more_length ); } add_filter('excerpt_length', 'gridpal_excerpt_length'); // Change excerpt more word function gridpal_excerpt_more($more) { if ( is_admin() ) { return $more; } return '...'; } add_filter('excerpt_more', 'gridpal_excerpt_more'); if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * * Added for backwards compatibility to support pre 5.2.0 WordPress versions. */ function wp_body_open() { // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedFunctionFound /** * Triggered after the opening <body> tag. */ do_action( 'wp_body_open' ); // phpcs:ignore WPThemeReview.CoreFunctionality.PrefixAllGlobals.NonPrefixedHooknameFound } endif; /** * Custom Hooks */ function gridpal_before_header() { do_action('gridpal_before_header'); } function gridpal_after_header() { do_action('gridpal_after_header'); } function gridpal_before_main_content() { do_action('gridpal_before_main_content'); } add_action('gridpal_before_main_content', 'gridpal_top_widgets', 20 ); add_action('gridpal_before_main_content', 'gridpal_top_left_right_widgets', 40 ); function gridpal_after_main_content() { do_action('gridpal_after_main_content'); } add_action('gridpal_after_main_content', 'gridpal_bottom_widgets', 10 ); function gridpal_sidebar_one() { do_action('gridpal_sidebar_one'); } add_action('gridpal_sidebar_one', 'gridpal_sidebar_one_widgets', 10 ); function gridpal_sidebar_two() { do_action('gridpal_sidebar_two'); } add_action('gridpal_sidebar_two', 'gridpal_sidebar_two_widgets', 10 ); function gridpal_before_single_post() { do_action('gridpal_before_single_post'); } function gridpal_before_single_post_title() { do_action('gridpal_before_single_post_title'); } function gridpal_after_single_post_title() { do_action('gridpal_after_single_post_title'); } function gridpal_top_single_post_content() { do_action('gridpal_top_single_post_content'); } function gridpal_bottom_single_post_content() { do_action('gridpal_bottom_single_post_content'); } function gridpal_after_single_post_content() { do_action('gridpal_after_single_post_content'); } function gridpal_after_single_post() { do_action('gridpal_after_single_post'); } function gridpal_before_single_page() { do_action('gridpal_before_single_page'); } function gridpal_before_single_page_title() { do_action('gridpal_before_single_page_title'); } function gridpal_after_single_page_title() { do_action('gridpal_after_single_page_title'); } function gridpal_after_single_page_content() { do_action('gridpal_after_single_page_content'); } function gridpal_after_single_page() { do_action('gridpal_after_single_page'); } function gridpal_before_comments() { do_action('gridpal_before_comments'); } function gridpal_after_comments() { do_action('gridpal_after_comments'); } function gridpal_before_footer() { do_action('gridpal_before_footer'); } function gridpal_after_footer() { do_action('gridpal_after_footer'); } function gridpal_before_nongrid_post_title() { do_action('gridpal_before_nongrid_post_title'); } function gridpal_after_nongrid_post_title() { do_action('gridpal_after_nongrid_post_title'); } /** * Media functions */ function gridpal_media_content_grid() { global $post; ?> <?php if ( !(gridpal_get_option('hide_thumbnail_home')) ) { ?> <?php if ( has_post_thumbnail($post->ID) ) { ?> <div class="gridpal-grid-post-thumbnail gridpal-grid-post-block"> <?php if ( gridpal_get_option('thumbnail_link_home') == 'no' ) { ?> <?php the_post_thumbnail('gridpal-480w-autoh-image', array('class' => 'gridpal-grid-post-thumbnail-img', 'title' => the_title_attribute('echo=0'))); ?> <?php } else { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" class="gridpal-grid-post-thumbnail-link" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail('gridpal-480w-autoh-image', array('class' => 'gridpal-grid-post-thumbnail-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } ?> <?php gridpal_grid_datebox(); ?> </div> <?php } else { ?> <?php if ( !(gridpal_get_option('hide_default_thumbnail')) ) { ?> <div class="gridpal-grid-post-thumbnail gridpal-grid-post-thumbnail-default gridpal-grid-post-block"> <?php if ( gridpal_get_option('thumbnail_link_home') == 'no' ) { ?> <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/no-image-480-360.jpg' ); ?>" class="gridpal-grid-post-thumbnail-img"/> <?php } else { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" class="gridpal-grid-post-thumbnail-link" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>"><img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/no-image-480-360.jpg' ); ?>" class="gridpal-grid-post-thumbnail-img"/></a> <?php } ?> <?php gridpal_grid_datebox(); ?> </div> <?php } ?> <?php } ?> <?php } ?> <?php } function gridpal_media_content_single() { global $post; if ( has_post_thumbnail() ) { if ( !(gridpal_get_option('hide_thumbnail')) ) { if ( gridpal_get_option('thumbnail_link') == 'no' ) { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-post.php' ) ) ) { the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } else { the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } ?> </div> <?php } else { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-post.php' ) ) ) { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } else { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } ?> </div> <?php } } } } function gridpal_media_content_single_location() { global $post; if( gridpal_get_option('featured_media_under_post_title') ) { add_action('gridpal_after_single_post_title', 'gridpal_media_content_single', 10 ); } else { add_action('gridpal_before_single_post_title', 'gridpal_media_content_single', 10 ); } } add_action('template_redirect', 'gridpal_media_content_single_location', 100 ); function gridpal_media_content_page() { global $post; ?> <?php if ( has_post_thumbnail() ) { if ( !(gridpal_get_option('hide_page_thumbnail')) ) { if ( gridpal_get_option('thumbnail_link_page') == 'no' ) { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-page.php' ) ) ) { the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } else { the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } ?> </div> <?php } else { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-page.php' ) ) ) { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } else { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } ?> </div> <?php } } } ?> <?php } function gridpal_media_content_page_location() { global $post; if( gridpal_get_option('featured_media_under_page_title') ) { add_action('gridpal_after_single_page_title', 'gridpal_media_content_page', 10 ); } else { add_action('gridpal_before_single_page_title', 'gridpal_media_content_page', 10 ); } } add_action('template_redirect', 'gridpal_media_content_page_location', 110 ); function gridpal_media_content_nongrid() { global $post; if ( has_post_thumbnail() ) { if ( !(gridpal_get_option('hide_thumbnail')) ) { if ( gridpal_get_option('thumbnail_link') == 'no' ) { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-post.php' ) ) ) { the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } else { the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); } ?> </div> <?php } else { ?> <div class="gridpal-post-thumbnail-single"> <?php if ( is_page_template( array( 'template-full-width-post.php' ) ) ) { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-1218w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } else { ?> <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php /* translators: %s: post title. */ echo esc_attr( sprintf( __( 'Permanent Link to %s', 'gridpal' ), the_title_attribute( 'echo=0' ) ) ); ?>" class="gridpal-post-thumbnail-single-link"><?php the_post_thumbnail('gridpal-680w-autoh-image', array('class' => 'gridpal-post-thumbnail-single-img', 'title' => the_title_attribute('echo=0'))); ?></a> <?php } ?> </div> <?php } } } } function gridpal_media_content_nongrid_location() { if( gridpal_get_option('featured_nongrid_media_under_post_title') ) { add_action('gridpal_after_nongrid_post_title', 'gridpal_media_content_nongrid', 10 ); } else { add_action('gridpal_before_nongrid_post_title', 'gridpal_media_content_nongrid', 10 ); } } add_action('template_redirect', 'gridpal_media_content_nongrid_location', 120 ); /** * Enqueue scripts and styles */ function gridpal_scripts() { wp_enqueue_style('gridpal-maincss', get_stylesheet_uri(), array(), NULL); wp_enqueue_style('fontawesome', get_template_directory_uri() . '/assets/css/all.min.css', array(), NULL ); wp_enqueue_style('gridpal-webfont', '//fonts.googleapis.com/css?family=Oswald:400,700|Frank+Ruhl+Libre:400,700|Pridi:400,700&display=swap', array(), NULL); $gridpal_fitvids_active = FALSE; if ( gridpal_is_fitvids_active() ) { $gridpal_fitvids_active = TRUE; } if ( $gridpal_fitvids_active ) { wp_enqueue_script('fitvids', get_template_directory_uri() .'/assets/js/jquery.fitvids.min.js', array( 'jquery' ), NULL, true); } $gridpal_primary_menu_active = FALSE; if ( gridpal_is_primary_menu_active() ) { $gridpal_primary_menu_active = TRUE; } $gridpal_secondary_menu_active = FALSE; if ( gridpal_is_secondary_menu_active() ) { $gridpal_secondary_menu_active = TRUE; } $gridpal_sticky_header_active = TRUE; $gridpal_sticky_header_mobile_active = FALSE; $gridpal_sticky_sidebar_active = TRUE; if ( is_page_template( array( 'template-full-width-page.php', 'template-full-width-post.php' ) ) ) { $gridpal_sticky_sidebar_active = FALSE; } if ( is_404() ) { $gridpal_sticky_sidebar_active = FALSE; } if ( $gridpal_sticky_sidebar_active ) { wp_enqueue_script('ResizeSensor', get_template_directory_uri() .'/assets/js/ResizeSensor.min.js', array( 'jquery' ), NULL, true); wp_enqueue_script('theia-sticky-sidebar', get_template_directory_uri() .'/assets/js/theia-sticky-sidebar.min.js', array( 'jquery' ), NULL, true); } $gridpal_columnwidth = '.gridpal-3-col-sizer'; $gridpal_gutter = '.gridpal-3-col-gutter'; wp_enqueue_script('gridpal-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), NULL, true ); wp_enqueue_script('gridpal-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), NULL, true ); wp_enqueue_script('gridpal-customjs', get_template_directory_uri() .'/assets/js/custom.js', array( 'jquery', 'imagesloaded', 'masonry' ), NULL, true); wp_localize_script( 'gridpal-customjs', 'gridpal_ajax_object', array( 'ajaxurl' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), 'primary_menu_active' => $gridpal_primary_menu_active, 'secondary_menu_active' => $gridpal_secondary_menu_active, 'sticky_header_active' => $gridpal_sticky_header_active, 'sticky_header_mobile_active' => $gridpal_sticky_header_mobile_active, 'sticky_sidebar_active' => $gridpal_sticky_sidebar_active, 'fitvids_active' => $gridpal_fitvids_active, 'columnwidth' => $gridpal_columnwidth, 'gutter' => $gridpal_gutter, ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script('gridpal-html5shiv-js', get_template_directory_uri() .'/assets/js/html5shiv.js', array('jquery'), NULL, true); wp_localize_script('gridpal-html5shiv-js','gridpal_custom_script_vars',array( 'elements_name' => esc_html__('abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', 'gridpal'), )); } add_action( 'wp_enqueue_scripts', 'gridpal_scripts' ); /** * Enqueue IE compatible scripts and styles. */ function gridpal_ie_scripts() { wp_enqueue_script( 'respond', get_template_directory_uri(). '/assets/js/respond.min.js', array(), NULL, false ); wp_script_add_data( 'respond', 'conditional', 'lt IE 9' ); } add_action( 'wp_enqueue_scripts', 'gridpal_ie_scripts' ); /** * Enqueue customizer styles. */ function gridpal_enqueue_customizer_styles() { wp_enqueue_style( 'gridpal-customizer-styles', get_template_directory_uri() . '/assets/css/customizer-style.css', array(), NULL ); wp_enqueue_style('fontawesome', get_template_directory_uri() . '/assets/css/all.min.css', array(), NULL ); } add_action( 'customize_controls_enqueue_scripts', 'gridpal_enqueue_customizer_styles' ); // Header styles if ( ! function_exists( 'gridpal_header_style' ) ) : function gridpal_header_style() { $header_text_color = get_header_textcolor(); //if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { return; } ?> <style type="text/css"> <?php if ( ! display_header_text() ) : ?> .gridpal-site-title, .gridpal-site-description {position: absolute;clip: rect(1px, 1px, 1px, 1px);} <?php else : ?> .gridpal-site-title, .gridpal-site-title a, .gridpal-site-description {color: #<?php echo esc_attr( $header_text_color ); ?>;} <?php endif; ?> </style> <?php } endif;