add_filter('pre_get_posts','SearchFilter');
add_theme_support('post-thumbnails');
$defaults = array(
- 'default-color' => '',
- 'default-image' => '',
- 'default-repeat' => '',
- 'default-position-x' => '',
- 'default-attachment' => '',
- 'wp-head-callback' => '_custom_background_cb',
- 'admin-head-callback' => '',
- 'admin-preview-callback' => ''
+ 'default-color' => '',
+ 'default-image' => '',
+ 'default-repeat' => '',
+ 'default-position-x' => '',
+ 'default-attachment' => '',
+ 'wp-head-callback' => '_custom_background_cb',
+ 'admin-head-callback' => '',
+ 'admin-preview-callback' => ''
);
add_theme_support( 'custom-background', $defaults );
set_post_thumbnail_size(120, 100, true);
}
add_action('wp_enqueue_scripts', 'glm_site_scripts');
+
+function glm_blog_bread_crumbs()
+{
+ global $post;
+ $post_to_page = array(
+ 18 => 1257,
+ 26 => 11786,
+ 68 => 6963,
+ 69 => 11783
+ );
+ $breadcrumbs = array();
+ // find out which category this post is in.
+ if ($post) {
+ $post_categories = wp_get_post_categories( $post->ID );
+ //echo '<pre>' . print_r($post_categories, true) . '</pre>';
+ if ($post_to_page[$post_categories[0]]) {
+ $pageId = $post_to_page[$post_categories[0]];
+ $breadcrumbs[] = '<span typeof="v:Breadcrumb"><a href="' . esc_url( get_permalink( $pageId ) ) . '">' . get_the_title( $pageId ) . '</a></span>';
+ glm_get_menu_ancestors_by_page_id( $pageId );
+ }
+ $breadcrumbs[] = '<span typeof="v:Breadcrumb"><a href="' . get_bloginfo('url') . '">Home</a></span>';
+ echo implode(' ', array_reverse($breadcrumbs));
+ }
+}
+function glm_get_menu_ancestors_by_page_id($page)
+{
+ if ( ( $locations = get_nav_menu_locations() ) && isset( $locations['top-bar'] ) ) {
+ $menu = wp_get_nav_menu_object( $locations['top-bar'] );
+ $menu_items = wp_get_nav_menu_items( $menu->term_id );
+ foreach ((array) $menu_items as $key => $menu_item) {
+ $sideMenu[$menu_item->menu_item_parent][] = $menu_item;
+ $allMenu[$menu_item->ID] = $menu_item;
+ if ($menu_item->object_id == $post->ID) {
+ $pageMenuId[] = $menu_item;
+ }
+ }
+ echo '<pre>' . print_r($sideMenu, true) . '</pre>';
+ }
+}
?>
<?php get_header(); ?>
+
<main class="blog-single">
+ <div id="con" class="row">
+ <div class="small-12 columns">
+ <?php get_template_part('parts/blog-bread-crumbs');?>
+ </div>
+ </div>
<div class="row">
<?php if (get_post_type( $post ) == "ai1ec_event") { ?>
<div id="blog-posts-over" class="ai1ec-post small-12 medium-10 medium-centered columns">
- <?php
- get_template_part('parts/bread-crumbs');
- ?>
<?php } else { ?>
<div id="blog-posts-over" class="small-12 medium-9 columns">
<?php } ?>