Пример #1
0
 *
 * @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 
Пример #2
0
/**
 * Gets the school image (set in fieldmanager)
 */
function hsinsider_get_school_image($image_size = 'thumbnail', $post = null)
{
    if (empty($post)) {
        $post = get_post();
    }
    $attachment_id = hsinsider_get_school_meta('logo', $post);
    if (empty($attachment_id)) {
        return false;
    }
    return wp_get_attachment_image_src($attachment_id, $image_size);
}