function permalink($permalink, $post)
 {
     if (empty($permalink) || empty($post) || strpos($permalink, '%category%') < 0) {
         return $permalink;
     }
     $school = hsinsider_get_school($post);
     if (!empty($school)) {
         return str_replace('%category%', $school->slug, $permalink);
     } else {
         return str_replace('%category%', 'hs-insider', $permalink);
     }
 }
Exemple #2
0
function hsinsider_do_omniture_footer()
{
    $pageName = '';
    $channel = '';
    if (($school = hsinsider_get_school()) && !empty($school)) {
        $pageName = ':school:' . $school->slug . (is_single() ? ':' . get_the_ID() . '-' . get_post()->post_name : '');
        $channel = ':school:' . $school->slug;
    } elseif (is_tag()) {
        $term = get_queried_object();
        $pageName = ':tag:' . $term->slug;
        $channel = ':tag';
    } elseif (is_category()) {
        $term = get_queried_object();
        $pageName = ':category:' . $term->slug;
        $channel = ':category';
    }
    //Truncate to 60 chars, to avoid the entire pageName string going over 100
    $pageName = substr($pageName, 0, 60);
    echo '
	<script type="text/javascript">
		((((window.trb || (window.trb = {})).data || (trb.data = {})).metrics || (trb.data.metrics = {})).thirdparty = {
			pageName: "lat:highschool:hsinsider' . esc_attr($pageName) . ':articleproject",
			channel: "hsinsider' . esc_attr($channel) . '",
			server: "highschool.latimes.com",
			hier1: "latimes:hsinsider' . esc_attr($channel) . '",
			hier2: "hsinsider' . esc_attr($channel) . '",
			prop1: "D=pageName",
			prop2: "hsinsider",
			prop38: "articleproject",
			prop57: "D=c38",
			eVar20: "latimes",
			eVar21: "D=c38",
			eVar34: "D=ch",
			eVar35: "D=pageName",
			events:""
		});
	</script>
	<script src="http://www.latimes.com/thirdpartyservice?disablenav=true&disablessor=true" async></script>';
}
 * @package HSInsider
 */
get_header();
$term = wpcom_vip_get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
/**
* If the taxonomy term exists, do stuff
*/
if (is_object($term)) {
    ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main container-fluid" role="main">
			<header class="hero jumbotron blogroll archive-header row">
				<?php 
    $school_address = hsinsider_get_school_meta('address');
    $school = hsinsider_get_school();
    //Defaults
    $school_marker = 'none';
    if (!empty($school_address)) {
        $school_marker = array('school' => $school->name, 'address' => $school_address);
        $school_marker = json_encode($school_marker);
    }
    ?>
				<section class="col-xs-12">
					<!-- Social Share -->
					<?php 
    ai_get_template_part('template-parts/module', 'share', array('title' => get_the_title(), 'url' => get_term_link($term)));
    ?>
					<!-- title -->
					<h1 class="entry-title school-title"><?php 
    echo esc_html($school->name);
/**
 * Prints a link to the school page
 */
function hsinsider_school_link($class = 'school', $post = null)
{
    if (empty($post)) {
        $post = get_post();
    }
    $term = hsinsider_get_school($post);
    if (empty($term)) {
        return;
    }
    $term_link = hsinsider_get_school_link($post);
    if (empty($term_link)) {
        return;
    }
    echo '<a href="' . esc_url($term_link) . '" class="' . esc_attr($class) . '">' . esc_html($term->name) . '<i class="LATLinkOutArrow"></i></a>';
}
<header id="masthead" class="site-header" role="banner">
	<nav id="navigation" <?php 
if (hsinsider_get_school() || is_category()) {
    ?>
class="has-school <?php 
    if (hsinsider_has_school_image()) {
        ?>
has-school-image<?php 
    }
    ?>
"<?php 
}
?>
>
		<div class="container">
			<div class="row">
				<div class="col-md-12">
					<a class="hsinsider-logo" href="<?php 
echo esc_url(home_url());
?>
">
						<img class="img-responsive hidden-xs hidden-sm" src="<?php 
echo esc_url(get_stylesheet_directory_uri() . '/static/images/hsinsider-logo-full.png');
?>
" >
						<img class="img-responsive hidden-md hidden-lg" src="<?php 
echo esc_url(get_stylesheet_directory_uri() . '/static/images/hsinsider-logo-small.png');
?>
" >
					</a>
					<span class="tagline"><?php