function mtm_acf_image_property($field = '', $property = '')
{
    if (_get_field($field)) {
        $image = get_field($field);
        return $image[$property];
    }
}
?>
        </div>
        <div class="single-project--credits">
            <?php 
if (_get_field('mtm_project_website')) {
    ?>
                <a class="single-project--website" href="<?php 
    the_field('mtm_project_website');
    ?>
"><?php 
    the_title();
    _e(' Website', 'spring');
    ?>
</a>
            <?php 
}
if (_get_field('mtm_project_credits')) {
    ?>
                <div class="single-project--attribution">
                    <?php 
    the_field('mtm_project_credits');
    ?>
                </div>
            <?php 
}
?>

        </div>

    </div>
</article>
<?php

// Taxonomy Grid
$grid_query = mtm_taxonomy_query('grid');
$taxonomy = mtm_acf_taxonomy_property('grid', 'taxonomy');
?>

<div <?php 
post_class('mtm-component--main');
?>
>
	<?php 
mtm_get_template_part('mtm-content', 'component-page');
?>
	<?php 
if (_get_field('mtm_show_taxonomy_links')) {
    mtm_terms_from_taxonomy_links($taxonomy);
    // output taxonomy
}
?>
</div>

<?php 
if ($grid_query->have_posts()) {
    ?>

	<div class="mtm-component--content mtm-grid--wrapper">
		<div class="gallery-dynamic-row" >

			<?php 
    while ($grid_query->have_posts()) {
$pageurl = esc_url(get_permalink());
$pagetitle = esc_html(get_the_title());
$image_attributes = wp_get_attachment_image_src($attachment_id = get_post_thumbnail_id($post->ID), $size = 'full');
if ($image_attributes) {
    $featuredimage = esc_url($image_attributes[0]);
}
// Build social sharing parameter links
$facebookshare = 'http://www.facebook.com/sharer.php?u=' . $pageurl;
$twittershare = 'https://twitter.com/intent/tweet?url=' . $pageurl . '&text=' . $pagetitle;
$linkedinshare = 'http://www.linkedin.com/shareArticle?url=' . $pageurl . '&title=' . $pagetitle;
$googleshare = 'https://plus.google.com/share?url=' . $pageurl;
$pinterestshare = 'https://pinterest.com/pin/create/bookmarklet/?media=' . $featuredimage . '&url=' . $pageurl . '&description=' . $pagetitle;
$emailshare = 'mailto:?&subject=' . $emailsubject . '&body=' . $pagetitle . '%0A' . $pageurl;
// Get display options from ACF options page
if (_get_field('hide_social_share_buttons', 'options')) {
    $selected = _get_field('hide_social_share_buttons', 'options');
    if (in_array('hide-facebook', $selected)) {
        $hidefacebook = true;
    }
    if (in_array('hide-twitter', $selected)) {
        $hidetwitter = true;
    }
    if (in_array('hide-linkedin', $selected)) {
        $hidelinkedin = true;
    }
    if (in_array('hide-google', $selected)) {
        $hidegoogle = true;
    }
    if (in_array('hide-pinterest', $selected)) {
        $hidepinterest = true;
    }
Example #5
0
<section id="mobile-nav">
	<a href="#" class="mobile-drop">
		<img src="<?php 
echo get_stylesheet_directory_uri();
?>
/images/menu-icon.png"/>
	</a>
	<section class="mobile-search"><?php 
echo mobile_search_form();
?>
</section>
</section>
<section id="mobile-drop-menu">
	<div class="section-container accordion" data-section="accordion">
		<?php 
$ca_columns = _get_field('ca_column', 'option');
$colcount = count($ca_columns);
foreach ($ca_columns as $column) {
    $col_head = $column['column_heading'];
    $col_sub = $column['column_subhead'];
    $see_all_link = $column['see_all_link'];
    $see_all_label = $column['see_all_label'];
    ?>
			<section>
				<p class="title" data-section-title><?php 
    echo $col_head;
    ?>
</p>
				<div class="content" data-section-content>
					<?php 
    $col_links = $column['column_link'];
')">
Hi
	<section class ="content--page">
	
		<h1><?php 
the_title();
edit_post_link('(Edit)', ' • ');
?>
</h1>
		<?php 
$home_post = get_post(get_the_ID());
echo apply_filters('the_content', $home_post->post_content);
?>
		
		<?php 
if (_get_field('mtm_home_button_repeater')) {
    mtm_get_template_part('mtm-content', 'home-buttons');
}
?>
	    <div class="home-head-container">
			<?php 
if (has_post_thumbnail()) {
    ?>
	            <a href="#contact"><figure class="post--thumbnail home-head"><?php 
    the_post_thumbnail('full');
    ?>
</figure></a>
	    	<?php 
}
?>
		</div>
/**
 * Shortcut for 'echo _get_field()'
 * @param str $key The meta key
 * @param mixed $id The post ID (int|str, defaults to $post->ID)
 * @param mixed $default Value to return if there's no value for the custom field $key
 * @return void
 * @uses _get_field()
 */
function _the_field($key, $id = false, $default = '')
{
    echo _get_field($key, $id, $default);
}
<?php

/*
Template Name: Home Page Builder
*/
mtm_load_wrap_header();
// Standard Homepage
mtm_get_template_part('mtm-layout', 'home-standard');
// Single Scroll
if (_get_field('mtm_enable_single_scroll_page')) {
    mtm_get_template_part('mtm-logic', 'single-scroll');
}
mtm_load_wrap_footer();
Example #9
0
<?php

/**
 * Page Title.
 *
 * @package Chroma_Theme
 */
if (_get_field('headline_display') != 'none') {
    ?>

<header class="page-header">
	<div class="container">
		<h1 class="page-title">
		<?php 
    if (_get_field('headline_display') == 'alternate') {
        _the_field('alternate_headline');
    } else {
        the_title();
    }
    if (_get_field('include_subhead')) {
        echo '<br><small>';
        _the_field('headline_subhead');
        echo '</small>';
    }
    ?>
		</h1>
	</div>
</header><!-- .page-header -->

<?php 
}
// List Archive
if ("List Archive" == _get_field('mtm_select_component')) {
    // Select a taxonomy to display list
    if ("Pick From Taxonomy" == _get_field('mtm_list_archive_select')) {
        mtm_get_template_part('mtm-component', 'taxonomy-list');
        // Manually pick posts to display list
    } else {
        mtm_get_template_part('mtm-component', 'manual-list');
    }
    // Grid Archive
} elseif ("Grid Archive" == _get_field('mtm_select_component')) {
    // Select a taxonomy to display grid
    if ("Pick From Taxonomy" == _get_field('mtm_grid_archive_select')) {
        mtm_get_template_part('mtm-component', 'taxonomy-grid');
        // Manually pick posts to display grid
    } else {
        mtm_get_template_part('mtm-component', 'manual-grid');
    }
    // Tabs
} elseif ("Tabs" == _get_field('mtm_select_component')) {
    mtm_get_template_part('mtm-component', 'tabs');
    // CTA
} elseif ("Call To Action" == _get_field('mtm_select_component')) {
    mtm_get_template_part('mtm-component', 'call-to-action');
    // Extra Content
} elseif ("Extra Content" == _get_field('mtm_select_component')) {
    mtm_get_template_part('mtm-component', 'extra-content');
    // Standard Content or None Selected
} else {
    mtm_get_template_part('mtm-component', 'standard');
}
Example #11
0
function ca_mega_columns()
{
    $ca_columns = _get_field('ca_column', 'option');
    $colcount = count($ca_columns);
    if ($ca_columns) {
        ?>
		<ul class="small-block-grid-1 large-block-grid-<?php 
        echo $colcount;
        ?>
 top-set">
			<?php 
        foreach ($ca_columns as $column) {
            ?>
				<li class="megacol">
					<?php 
            $col_head = $column['column_heading'];
            $col_sub = $column['column_subhead'];
            $see_all_link = $column['see_all_link'];
            $see_all_label = $column['see_all_label'];
            ?>

				 	<h4><?php 
            echo $col_head;
            ?>
</h4>
					<h5><?php 
            echo $col_sub;
            ?>
</h5>
					<?php 
            $col_links = $column['column_link'];
            ?>
					<ul>
						<?php 
            foreach ($col_links as $link) {
                if ($link) {
                    $link_url = $link['link_url'];
                    $link_text = $link['link_text'];
                    ?>
								<li><a href="<?php 
                    echo $link_url;
                    ?>
"><?php 
                    echo $link_text;
                    ?>
</a></li>
							<?php 
                }
            }
            ?>
					</ul>
					<?php 
            if ($see_all_link) {
                ?>
					<p class="see-all arrow"><a href="<?php 
                echo $see_all_link;
                ?>
"><?php 
                echo $see_all_label;
                ?>
</a></p>
					<?php 
            }
            ?>
				</li>
				<?php 
            //var_export( $column );
            ?>
			<?php 
        }
        ?>
		</ul>
	<?php 
    }
    /*		if( have_rows('columns','option') ):
    		echo '<ul class="small-block-grid-1 large-block-grid-3 top-set">';
    			 while ( have_rows('columns','option') ) : the_row();
    			 echo '<li>';
    				echo '<h4>'; the_sub_field('heading','option'); echo '</h4>';
    				echo '<section class="sub-content">'; the_sub_field('content','option'); echo '</section>';
    				echo '<h6>'; the_sub_field('sub_heading','option'); echo '</h6>';
    			 echo '</li>';
    			 endwhile;
    		echo '</ul>';
    		endif;
    
    		echo '<ul class="small-block-grid-1 large-block-grid-3 bottom-set">';
    			echo '<li>';
    				if( have_rows('product_articles','option')):
    				echo '<section class="product-articles">';
    				while (have_rows('product_articles','option') ) : the_row();
    					$articles = get_sub_field('article','option');
    					foreach ($articles as $article) {
    						$title = get_the_title($article->ID);
    						$permalink = get_permalink($article->ID);
    						echo '<p>';
    						echo '<a href="'.$permalink.'">'.$title.'</a>';
    						echo '</p>';
    					}
    				endwhile;
    				echo '</section>';
    				endif;
    
    				echo '<p>Or choose from Featured Category</p>';
    				if( have_rows('product_category','option') ): while ( have_rows('product_category','option') ) : the_row();
    					$product_id = get_sub_field('category_name','option');
    					$product_name = get_cat_name( $product_id );
    					$product_link = get_sub_field('category_link','option');
    					echo '<p><a class="arrow" href="'.$product_link.'">'.$product_name.'</a></p>';
    				endwhile; endif;
    			echo '</li>';
    
    			echo '<li>';
    				if( have_rows('lifestyle_articles','option')):
    				echo '<section class="lifestyle-articles">';
    				while (have_rows('lifestyle_articles','option') ) : the_row();
    					$articles = get_sub_field('article','option');
    					foreach ($articles as $article) {
    						$title = get_the_title($article->ID);
    						$permalink = get_permalink($article->ID);
    						echo '<p>';
    						echo '<a href="'.$permalink.'">'.$title.'</a>';
    						echo '</p>';
    					}
    				endwhile;
    				echo '</section>';
    				endif;
    
    				$lifestyle = get_category_by_slug('lifestyle');
    				$lifestyle_id = $lifestyle->term_id;
    				$lifestyle_url = get_category_link( $lifestyle_id);
    				echo '<a class="see-all arrow" href="'.$lifestyle_url.'">See All Articles</a>';
    			echo '</li>';
    
    			echo '<li>';
    				echo ca_mega_news();
    				$news = get_category_by_slug('news-events');
    				$news_id = $news->term_id;
    				$news_url = get_category_link( $news_id);
    				echo '<a class="arrow see-all" href="'.$news_url.'">See All News</a>';
    			echo '</li>';
    
    		echo '</ul>';
    */
}
?>
</h1>
		<?php 
// the_content();
// Something is filtering the_content, figure out what that is so I can change this
$home_post = get_post(get_the_ID());
echo apply_filters('the_content', $home_post->post_content);
// Buttons
if (_get_field('mtm_home_button_repeater')) {
    mtm_get_template_part('mtm-content', 'home-buttons');
}
// Featured Image
if (has_post_thumbnail()) {
    ?>
	            <figure class="post--thumbnail"><?php 
    the_post_thumbnail('full');
    ?>
</figure>
	    <?php 
}
?>

	</section>

</section>

<?php 
// Featured Content
if (_get_field('mtm_enable_featured_content')) {
    mtm_get_template_part('mtm-home', 'featured-content');
}
<?php

if (_get_field('mtm_extra_content_area')) {
    ?>

	<div class="mtm-component--content mtm-extra-content">
	
		<?php 
    the_field('mtm_extra_content_area');
    ?>
	

	</div>		

<?php 
}
			<?php 
if (has_post_thumbnail()) {
    ?>

		            <figure class="post--thumbnail"><?php 
    the_post_thumbnail('full');
    ?>
</figure>

		    <?php 
}
?>

		    <?php 
if (is_active_sidebar('news-page-sidebar')) {
    dynamic_sidebar('news-page-sidebar');
}
?>

		</div>

	</section>

</section>

<?php 
// Topics
if (_get_field('mtm_home_topic_sections')) {
    mtm_get_template_part('mtm-logic', 'topic-sections');
}
<?php

// Featured News Story Logic
// Latest Post
if ("Latest Post" == _get_field('mtm_home_select_featured_story_source')) {
    $posttype = get_field('mtm_home_select_featured_story_type');
    $news_post_query = mtm_page_component_post_query($posttype, 1);
    while ($news_post_query->have_posts()) {
        $news_post_query->the_post();
        mtm_get_template_part('mtm-content', 'home-featured-story');
    }
    // Latest Taxonomy Post
} elseif ("Latest Post From Taxonomy" == _get_field('mtm_home_select_featured_story_source')) {
    $news_tax_query = mtm_taxonomy_query('home_featured_story', 1);
    while ($news_tax_query->have_posts()) {
        $news_tax_query->the_post();
        mtm_get_template_part('mtm-content', 'home-featured-story');
    }
    // Specific Post
} elseif ("Specific Post" == _get_field('mtm_home_select_featured_story_source')) {
    $post_object = get_field('mtm_home_featured_story_select_single');
    if ($post_object) {
        $post = $post_object;
        setup_postdata($post);
        mtm_get_template_part('mtm-content', 'home-featured-story');
    }
}