* Header Block - masthead * * This block renders below the Navbar and above site content * **/ ?> <header id="masthead" class="page-header" role="banner"> <?php tha_header_top(); ?> <?php if (pgb_get_option('show_breadcrumb') == '1') { pgb_block_breadcrumbs(); } ?> <div class="container"> <div class="row"> <div class="hidden-xs hidden-sm col-md-4 col-lg-3"> <?php pgb_get_logo(); ?> </div> <?php pgb_block_page_title(); ?> </div> </div><!-- .container --> <?php tha_header_bottom(); ?> </header><!-- #masthead -->
<!-- .navbar-toggle is used as the toggle for collapsed navbar content --> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- Your site title as branding in the menu --> <a class="navbar-brand" href="<?php echo esc_url(home_url('/')); ?> " title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?> " rel="home"><?php echo pgb_get_logo(); ?> </a> </div> <div class="collapse navbar-collapse navbar-responsive-collapse"> <?php if (pgb_get_option('nav_search') == '1') { get_template_part('searchform', 'nav'); } // Show search form ?> <?php // Main Menu wp_nav_menu(array('theme_location' => 'primary', 'container' => false, 'menu_class' => 'nav navbar-nav ' . esc_attr($menuleftright), 'fallback_cb' => '', 'menu_id' => 'main-menu', 'walker' => new wp_bootstrap_navwalker())); ?> </div>
/** * Custom login logo * * @since ProGo 0.7.0 * @param none * @return CSS replaces logo image on login */ public static function pgb_login_logo() { $logo_url = pgb_get_logo(false); ?> <style type="text/css"> .login h1 a { background-image: url(<?php echo $logo_url; ?> ); padding-bottom: 30px; } </style> <?php }
function pgb_rich_snippets() { global $post, $wp_query; $post_id = get_queried_object_id(); $post_object = get_post($post_id); /* Front Page */ if (is_front_page()) { $front_page_snippet = array("@context" => "http://schema.org", "@type" => get_option('rich_snippet_type', false) ? get_option('rich_snippet_type', 'WebSite') : 'WebSite', "url" => get_bloginfo('url'), "name" => get_bloginfo('name'), "logo" => pgb_get_logo(false)); if (pgb_includes_search()) { $page_includes_search = array("potentialAction" => array("@type" => "SearchAction", "target" => get_bloginfo('url') . "/?s={search}", "query-input" => "required name=search")); $front_page_snippet = array_merge($front_page_snippet, $page_includes_search); } pgb_print_snippet($front_page_snippet); } elseif (is_search()) { $search_page_snippet = array("@context" => "http://schema.org", "@type" => "SearchResultsPage", "url" => get_search_link(), "mainEntityOfPage" => array("@type" => "SearchAction", "query" => get_search_query())); pgb_print_snippet($search_page_snippet); } elseif (is_blog_page()) { $blog_page_snippet = array("@type" => 'Blog', "url" => get_permalink($post_id), "BlogPost" => array()); if (have_posts()) { while (have_posts()) { the_post(); $blog_page_snippet["BlogPost"][] = array("@type" => "BlogPosting", "headline" => get_the_title(), "datePublished" => get_the_date("Y-m-d\\TH:i:sP"), "articleBody" => wp_strip_all_tags(get_the_content())); } } pgb_print_snippet($blog_page_snippet); } /* Blog Post */ if (is_single()) { $single_post_snippet = array("@type" => 'BlogPosting', "url" => get_permalink($post_id), "headline" => get_the_title($post_id), "datePublished" => get_the_date("Y-m-d\\TH:i:sP", $post_id), "articleBody" => wp_strip_all_tags($post_object->post_content), "author" => get_the_author_meta('user_nicename', $post_object->post_author)); if (has_post_thumbnail($post_id)) { $post_thumbnail_id = get_post_thumbnail_id($post_id); $post_thumbnail = get_post($post_thumbnail_id); $image_snippet = array("image" => array("@type" => "ImageObject", "contentUrl" => wp_get_attachment_url($post_thumbnail_id), "datePublished" => $post_thumbnail->post_date, "description" => $post_thumbnail->post_content, "name" => $post_thumbnail->post_title)); $single_post_snippet = array_merge($single_post_snippet, $image_snippet); } pgb_print_snippet($single_post_snippet); } }