Exemple #1
0
/**
 * Get a search form if the ajax is activated
 * @return string HTML representation of the search form
 */
function aiga_nebraska_get_search_form()
{
    if (pjaxify(true)) {
        partial('searchform', 'ajax');
    } else {
        partial('searchform');
    }
}
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     if ($item->is_dropdown && $depth === 0) {
         $item_html = str_replace('<a', '<a class="dropdown-toggle ' . pjaxify(true) . '" data-toggle="dropdown" data-target="#"', $item_html);
         $item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html);
     } elseif (stristr($item_html, 'li class="divider')) {
         $item_html = preg_replace('/<a[^>]*>.*?<\\/a>/iU', '', $item_html);
     } elseif (stristr($item_html, 'li class="dropdown-header')) {
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '$1', $item_html);
     } else {
         $item_html = str_replace('<a', '<a class="' . pjaxify(true) . '"', $item_html);
     }
     $item_html = apply_filters('aiga_nebraska/wp_nav_menu_item', $item_html);
     $output .= $item_html;
 }
/**
 * Scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/main.css
 *
 * Enqueue scripts in the following order:
 * 1. jquery-1.11.1.min.js via Google CDN
 * 2. /theme/assets/js/vendor/modernizr.min.js
 * 3. /theme/assets/js/scripts.js
 *
 * @return null
 */
function aiga_nebraska_scripts()
{
    /**
     * The build task in Grunt renames production assets with a hash
     * Read the asset names from assets-manifest.json
     */
    $assets = array('css' => '/assets/css/main.css?v=1.03', 'compatibility' => '/assets/css/compatibility.css?v=1.02', 'js' => '/assets/js/min/scripts-min.js?v=1.02', 'element_queries' => '/assets/js/min/element_queries-min.js', 'modernizr' => '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js', 'detectizr' => '//cdnjs.cloudflare.com/ajax/libs/detectizr/2.2.0/detectizr.min.js', 'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', 'jquery-pjax' => '//cdnjs.cloudflare.com/ajax/libs/jquery.pjax/1.9.6/jquery.pjax.min.js', 'google-maps' => '//maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true', 'greensock' => '//cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js', 'analytics' => '/assets/js/jquery.scrolldepth.js');
    if (pjaxify(true)) {
        if (isset($_SERVER['HTTP_X_PJAX']) && $_SERVER['HTTP_X_PJAX'] == 'true') {
            if (!is_admin() && current_theme_supports('jquery-cdn')) {
                wp_deregister_script('jquery');
            }
        } else {
            // embed resources that we need only on first load
            just_enqueue_first_page_load($assets);
        }
    } else {
        just_enqueue_first_page_load($assets);
    }
}
/**
 * Clean up the_content()
 */
function modify_read_more_link()
{
    return '<a class="more-link button grey ' . pjaxify(true) . '" href="' . get_permalink() . '">Read&nbsp;more&nbsp;</a>';
}
Exemple #5
0
                ?>
						<?php 
            }
            ?>
					</div>
				<?php 
        }
        ?>
			<?php 
    }
    ?>
		</div>
	</section>
	<section class="navigation">
		<div class="container one-half bleed">
			<a class="column<?php 
    pjaxify();
    ?>
" href="/" title="How to enter">
				<div class="content"><span class="h2">How to enter</span></div>
			</a>
			<a class="column<?php 
    pjaxify();
    ?>
" href="/contact-us" title="Contact us">
				<div class="content"><span class="h2">Contact us</span></div>
			</a>
		</div>
	</section>
<?php 
}