コード例 #1
0
/**
 * Loads the scripts we need on first page load
 * @param  Array $assets Array of script uri's
 * @return null
 */
function just_enqueue_first_page_load($assets)
{
    // embed all resources
    wp_enqueue_style('aiga_nebraska_css', get_template_directory_uri() . $assets['css'], false, null);
    $css_files = sendo()->css;
    foreach ($css_files as $css) {
        wp_enqueue_style('aiga_nebraska_' . basename($css, '.css'), $css, false, null);
    }
    /**
     * jQuery is loaded using the same method from HTML5 Boilerplate:
     * Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
     * It's kept in the header instead of footer to avoid conflicts with plugins.
     */
    if (!is_admin()) {
        wp_deregister_script('jquery');
        wp_register_script('jquery', $assets['jquery'], array(), null, true);
        add_filter('script_loader_src', 'aiga_nebraska_jquery_local_fallback', 10, 2);
    }
    if (is_single() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    wp_enqueue_script('modernizr', $assets['modernizr'], array(), null, true);
    // Modernizr
    wp_enqueue_script('detectizr', $assets['detectizr'], array(), null, true);
    // Browser Detection (IE, Edge, Etc)
    wp_enqueue_script('greensock', $assets['greensock'], array(), null, true);
    // For animation
    // wp_enqueue_script('google-maps', $assets['google-maps'], array(), null, true);
    wp_enqueue_script('jquery');
    if (get_field('enable_ajax', 'options')) {
        wp_enqueue_script('jquery-pjax', $assets['jquery-pjax'], array(), null, true);
    }
    wp_enqueue_script('aiga_nebraska_element_queries', get_template_directory_uri() . $assets['element_queries'], array(), null, true);
    wp_enqueue_script('aiga_nebraska_js', get_template_directory_uri() . $assets['js'], array(), null, true);
    wp_enqueue_script('aiga_nebraska_analytics', get_template_directory_uri() . $assets['analytics'], array(), null, true);
}
コード例 #2
0
ファイル: header.php プロジェクト: aiganebraska/AIGA-Nebraska
  });

  var open_nav = function(el) {
    if (!$(el).hasClass('active')) {
      $('body, html').addClass('nav-open');
      $(el).addClass('active');
    } else {
      $('body, html').removeClass('nav-open');
      $(el).removeClass('active');
    }
  };

  var open_search = function(el) {
    if (!$(el).hasClass('active')) {
      $('body, html').removeClass('nav-open');
      $(el).addClass('active');
    } else {
      $(el).removeClass('active');
    }
  };

  $(document).keyup(function(e) {
    if (e.keyCode == 27) {
      $('body, html').removeClass('nav-open search-open');
      $('.hamburger').removeClass('active');
    }
  });
</script>
<?php 
sendo()->capture_javascript_end();
コード例 #3
0
            echo $username;
            ?>
/review" class="button button-outlined button-primary">REVIEW</a></p>
							</div>
						</div>
						<div class="column">
							<div class="content">
								<?php 
            the_field('pay_content');
            ?>
								<p style="text-align: center;"> <a href="/profile/<?php 
            echo $username;
            ?>
/pay" class="button button-outlined button-primary">FINALIZE SUBMISSIONS</a></p>
							</div>
						</div>
					</div>
				</section>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
	<?php 
}
?>

	<?php 
sendo()->init(array('title' => 'Show | ' . $user_object->nickname, 'description' => $user_object->description, 'image' => $large_version, 'url' => get_permalink()));
コード例 #4
0
ファイル: init_sendo.php プロジェクト: aiganebraska/The-Show
 /**
  * Output all stored data
  *
  * @return void
  */
 public function prepare_output()
 {
     $shareable_image = get_field('sdo_fallback_image') ? get_field('sdo_fallback_image') : get_field('sdo_fallback_image', 'options');
     $shareable_image = $shareable_image ? array_shift(wp_get_attachment_image_src($shareable_image, 'full')) : get_template_directory_uri() . '/assets/img/default-sharing.png';
     $twitter_card = get_field('sdo_twitter_card') && get_field('sdo_twitter_card') !== 'none' ? get_field('sdo_twitter_card') : get_field('sdo_twitter_card', 'options');
     $creator = get_field('sdo_twitter_card_creator') ? get_field('sdo_twitter_card_creator') : get_field('sdo_twitter_card_creator', 'options');
     /* TWITTER LOGIC */
     if ($twitter_card !== 'none') {
         $this->set_twitter_card('card', $twitter_card)->set_twitter_card('title', sendo()->title)->set_twitter_card('site', get_field('sdo_twitter_card_site', 'options'))->set_twitter_card('description', substr(get_the_excerpt(), 0, 140))->set_twitter_card('url', get_the_permalink())->set_twitter_card('creator', $creator);
         if ($twitter_card === 'summary_large_image' || $twitter_card === 'summary' || $twitter_card === 'photo') {
             $this->set_twitter_card('image', $shareable_image);
         }
         if ($twitter_card === 'gallery') {
             $gallery = get_field('sdo_twitter_card_gallery') ? get_field('sdo_twitter_card_gallery') : get_field('sdo_twitter_card_gallery', 'options');
             $i = 0;
             foreach ($gallery as $image) {
                 $this->set_twitter_card('image' . $i++, $image['image']);
             }
         }
         if ($twitter_card === 'app') {
             $app_country = get_field('sdo_twitter_card_app_country') ? get_field('sdo_twitter_card_app_country') : get_field('sdo_twitter_card_app_country', 'options');
             $this->set_twitter_card('image', $shareable_image);
             $this->set_twitter_card('app:country', $app_country);
             $all_app_details = get_field('sdo_twitter_card_app_details') ? get_field('sdo_twitter_card_app_details') : get_field('sdo_twitter_card_app_details', 'options');
             foreach ($all_app_details as $app_details) {
                 $this->set_twitter_card('app:name:' . $app_details['platform'], $app_details['app_name']);
                 $this->set_twitter_card('app:id:' . $app_details['platform'], $app_details['app_id']);
                 $this->set_twitter_card('app:url:' . $app_details['platform'], $app_details['app_url']);
             }
         }
         if ($twitter_card === 'player') {
             $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
             $all_video_details = get_field('sdo_twitter_card_app_video') ? get_field('sdo_twitter_card_app_video') : get_field('sdo_twitter_card_app_video', 'options');
             $this->set_twitter_card('image', $shareable_image);
             foreach ($all_video_details as $video_details) {
                 $this->set_twitter_card('player', $protocol . $_SERVER['SERVER_NAME'] . '/twitter_video_player?video=' . $video_details['player_stream']['id']);
                 $this->set_twitter_card('player:width', $video_details['player_stream']['width']);
                 $this->set_twitter_card('player:height', $video_details['player_stream']['height']);
                 $this->set_twitter_card('player:stream', $video_details['player_stream']['url']);
                 $this->set_twitter_card('player:stream:content_type', $video_details['player_stream']['mime_type']);
             }
         }
         if ($twitter_card === 'product') {
             $all_product_details = get_field('sdo_twitter_card_labels_and_data') ? get_field('sdo_twitter_card_labels_and_data') : get_field('sdo_twitter_card_labels_and_data', 'options');
             $this->set_twitter_card('image', $shareable_image);
             $i = 0;
             foreach ($all_product_details as $product_details) {
                 $this->set_twitter_card('label' . $i, $product_details['label']);
                 $this->set_twitter_card('data' . $i++, $product_details['data']);
             }
         }
     }
 }
コード例 #5
0
ファイル: index.php プロジェクト: aiganebraska/The-Show
            ?>
			<?php 
        } else {
            ?>
				<?php 
            partial('sections/layout', 'empty');
            ?>
			<?php 
        }
        ?>
		<?php 
    } elseif (get_field('layout_type') === 'custom_layout') {
        ?>
			<?php 
        global $wp_query;
        ?>
			<?php 
        include ABSPATH . 'wp-content/custom/' . $wp_query->post->post_type . '-' . $wp_query->post->post_name . '.php';
        ?>
			<?php 
        sendo()->append_css('/wp-content/custom/' . $wp_query->post->post_type . '-' . $wp_query->post->post_name . '.css');
        ?>
			<?php 
        sendo()->append_javascript('/wp-content/custom/' . $wp_query->post->post_type . '-' . $wp_query->post->post_name . '.js');
        ?>
		<?php 
    }
    ?>
	</article>
<?php 
}