weeding out and adding blocks to the front
authorIan Weller <ian@gaslightmedia.com>
Mon, 12 Jun 2017 19:32:19 +0000 (15:32 -0400)
committerIan Weller <ian@gaslightmedia.com>
Mon, 12 Jun 2017 19:32:19 +0000 (15:32 -0400)
I weeded out some things I believe we won't be using in this theme and
added the blocks call to the front page as well.  Plus did some grid
changes for the header.

functions.php
lib/EventRegistration.php [deleted file]
lib/partners-post-type.php [deleted file]
no-bottom-sections.php [deleted file]
parts/glm-blocks.php
sections/front-page.php
sections/header.php

index 7b2b01f..ca5a9bf 100644 (file)
@@ -1,9 +1,6 @@
 <?php
 require_once 'lib/menu-walker.php';
 require_once 'lib/navigation.php';
-require_once 'parts/glm-blocks.php';
-require_once 'lib/partners-post-type.php';
-require_once 'lib/EventRegistration.php';
 
 $ancestorId   = null;
 $includePages = array();
@@ -22,10 +19,6 @@ if (!function_exists('glm_quicksite_widget_init')) {
     }
 
 }
-// Block Defines //
-define("PARTNERS_BLOCKS", 30);
-
-define("DEFAULT_BLOCKS", 29);
 /**
  * Return the client info option for the given key
  *
diff --git a/lib/EventRegistration.php b/lib/EventRegistration.php
deleted file mode 100644 (file)
index 2e41bde..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-add_shortcode( 'glm-event-registrations', function( $atts ){
-    // Default entry into registrations application
-    if (!isset($_REQUEST['Action'])) {
-        $_REQUEST['Action'] = ''; // Action step
-        $_REQUEST['todo']   = 0; // Category
-        $_REQUEST['subcat'] = 0; // Sub-Category
-        $_REQUEST['event']  = 0; // Event ID
-    }
-
-    $_ENV['GLM_HOST_ID'] = 'DEVELOPMENT';
-    require_once get_template_directory() . '/setup/setup.phtml';
-    include_once '/var/www/server/app.gaslightmedia.com/Common/Registrations_V3/front-end/registrations.inc';
-} );
-add_action( 'init', function(){
-    if ( !session_id() ) {
-        session_start();
-    }
-});
-add_action( 'admin_bar_menu', function( $wp_admin_bar ){
-    $args = array(
-        'id'    => 'eventregistrations',
-        'title' => 'Event Registrations',
-        'href'  => 'http://dev53.gaslightmedia.com/www.ucgaylord.org/admin/Registrations/',
-        'meta'  => array(
-            'class'  => 'eventregistrations',
-            'title'  => 'Event Registrations',
-            'target' => '_blank'
-        )
-    );
-    $wp_admin_bar->add_node( $args );
-}, 999 );
diff --git a/lib/partners-post-type.php b/lib/partners-post-type.php
deleted file mode 100644 (file)
index d793b26..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-define( 'GLM_POST_TYPE', 'partners' );
-// Register Custom Post Type
-function custom_post_type() {
-
-    $labels = array(
-        'name'                  => _x( 'Partners', 'Post Type General Name', 'text_domain' ),
-        'singular_name'         => _x( 'Partner', 'Post Type Singular Name', 'text_domain' ),
-        'menu_name'             => __( 'Partners', 'text_domain' ),
-        'name_admin_bar'        => __( 'Partners', 'text_domain' ),
-        'archives'              => __( 'Partner Archives', 'text_domain' ),
-        'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),
-        'all_items'             => __( 'All Partners', 'text_domain' ),
-        'add_new_item'          => __( 'Add New Partner', 'text_domain' ),
-        'add_new'               => __( 'Add New', 'text_domain' ),
-        'new_item'              => __( 'New Item', 'text_domain' ),
-        'edit_item'             => __( 'Edit Item', 'text_domain' ),
-        'update_item'           => __( 'Update Item', 'text_domain' ),
-        'view_item'             => __( 'View Item', 'text_domain' ),
-        'search_items'          => __( 'Search Partners', 'text_domain' ),
-        'not_found'             => __( 'Not found', 'text_domain' ),
-        'not_found_in_trash'    => __( 'Not found in Trash', 'text_domain' ),
-        'featured_image'        => __( 'Featured Image', 'text_domain' ),
-        'set_featured_image'    => __( 'Set featured image', 'text_domain' ),
-        'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
-        'use_featured_image'    => __( 'Use as featured image', 'text_domain' ),
-        'insert_into_item'      => __( 'Insert into item', 'text_domain' ),
-        'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
-        'items_list'            => __( 'Items list', 'text_domain' ),
-        'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
-        'filter_items_list'     => __( 'Filter items list', 'text_domain' ),
-    );
-    $args = array(
-        'label'                 => __( 'Partner', 'text_domain' ),
-        'labels'                => $labels,
-        'supports'              => array('title', 'thumbnail', 'page-attributes'),
-        'hierarchical'          => false,
-        'public'                => false,
-        'show_ui'               => true,
-        'show_in_menu'          => true,
-        'menu_position'         => 5,
-        'show_in_admin_bar'     => true,
-        'show_in_nav_menus'     => true,
-        'can_export'            => true,
-        'has_archive'           => true,
-        'exclude_from_search'   => false,
-        'publicly_queryable'    => false,
-        'capability_type'       => 'page',
-        'register_meta_box_cb'  => 'add_metaboxes',
-    );
-    register_post_type( 'partners', $args );
-
-}
-add_action( 'init', 'custom_post_type', 0 );
-
-/**
- * Partner Info
- *
- * Adds the field for camper types
- *
- * @access public
- * @return void
- */
-function partner_info() {
-    global $post;
-    $name_value =
-    $title_value =
-    $email_value =
-    $phone_value =
-    $url_value = '';
-    $nonce = wp_create_nonce( 'title-meta-noncename' );
-    echo '<input type="hidden" name="title-meta-noncename" id="title-meta-noncename" value="' . $nonce . '" />';
-
-    $name = get_post_meta( $post->ID, 'partner_name', true );
-    if ( !empty( $name) ) {
-        $name_value = "value=".'"'.$name .'"';
-    }
-
-    $title = get_post_meta( $post->ID, 'partner_title', true );
-    if ( !empty( $title) ) {
-        $title_value = "value=".'"'.$title .'"';
-    }
-
-    $email = get_post_meta( $post->ID, 'partner_email', true );
-    if ( !empty( $email) ) {
-        $email_value = "value=".'"'.$email .'"';
-    }
-
-    $phone = get_post_meta( $post->ID, 'partner_phone', true );
-    if ( !empty( $phone) ) {
-        $phone_value = "value=".'"'.$phone .'"';
-    }
-
-    $url = get_post_meta( $post->ID, 'partner_url', true );
-    if ( !empty( $url) ) {
-        $url_value = "value=".'"'.$url .'"';
-        
-    $internal_url     = ($post)
-        ? get_post_meta($post->ID, 'internal_url', true)
-        : '';
-        
-    $internal_page    = ($post)
-        ? get_post_meta($post->ID, 'internal_page', true)
-        : '';
-        
-    } ?>
-
-    <label>Name: </label><input style="display: block;margin-bottom: 15px;" type="text" name="partner_name" <?php echo $name_value; ?> />
-    <label>Title: </label><input style="display: block;margin-bottom: 15px;" type="text" name="partner_title" <?php echo $title_value; ?> />
-    <label>E-Mail: </label><input style="display: block;margin-bottom: 15px;" type="text" name="partner_email" <?php echo $email_value; ?> />
-    <label>Phone: </label><input style="display: block;margin-bottom: 15px;" type="text" name="partner_phone" <?php echo $phone_value; ?> />
-    <label>URL (http:// not needed): </label><input style="display: block;margin-bottom: 15px;" type="text" name="partner_url" <?php echo $url_value; ?> />
-
-<input type="radio" name="internal_url" value="page"
-<?php if ($internal_url == 'page') {
-    echo 'checked';
-}; ?>>
-<label for="my_meta_box_post_type">Internal Page: </label>
-<?php
-wp_dropdown_pages(
-    array(
-        'depth'            => 0,
-        'child_of'         => 0,
-        'selected'         => $internal_page,
-        'echo'             => 1,
-        'name'             => 'internal_page',
-        'id'               => 'internal_page',
-        'show_option_none' => 'None',
-        'post_status'      => 'publish',
-        'post_type'        => 'page'
-    )
-);
-}
-
-/**
- * Save Meta Data
- *
- * Saves the meta fields for the product
- *
- * @access public
- * @return void
- */
-function save_meta() {
-    global $post;
-    if ( isset( $_POST['title-meta-noncename'] ) && ! wp_verify_nonce( $_POST['title-meta-noncename'], 'title-meta-noncename' ) ) {
-        return $post->ID;
-    }
-    if ( isset( $post ) && ! current_user_can( 'edit_post', $post->ID ) ) {
-        return $post->ID;
-    }
-    $name  = ( isset( $_POST['partner_name'] )  ? filter_var( $_POST['partner_name'] ) : '' );
-    $title = ( isset( $_POST['partner_title'] ) ? filter_var( $_POST['partner_title'] ) : '' );
-    $email = ( isset( $_POST['partner_email'] ) ? filter_var( $_POST['partner_email'] )  : '');
-    $phone = ( isset( $_POST['partner_phone'] ) ? filter_var( $_POST['partner_phone'] )  : '');
-    $url   = ( isset( $_POST['partner_url'] )   ? filter_var( $_POST['partner_url'] )  : '');
-    
-    if ( isset( $post ) ) {
-        update_post_meta( $post->ID, 'partner_name', $name );
-        update_post_meta( $post->ID, 'partner_title', $title );
-        update_post_meta( $post->ID, 'partner_email', $email );
-        update_post_meta( $post->ID, 'partner_phone', $phone );
-        update_post_meta( $post->ID, 'partner_url', $url );
-        update_post_meta($post->ID, 'internal_url', $_POST['internal_url']);
-        update_post_meta($post->ID, 'internal_page', $_POST['internal_page']);
-    }
-}
-
-/**
- * add_metaboxes
- *
- * Add the meta fields
- *
- * @access public
- * @return void
- */
-function add_metaboxes() {
-    add_meta_box( 'partner_info', 'Partner Information', 'partner_info', GLM_POST_TYPE, 'normal', 'low' );
-}
-add_action( 'save_post', 'save_meta' );
diff --git a/no-bottom-sections.php b/no-bottom-sections.php
deleted file mode 100644 (file)
index b4156ed..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/*
-Template Name: No Bottom Sections "Do Not Use"
-*/
-?>
-<!doctype html>
-<html class="no-js" lang="en">
-    <?php get_template_part("parts/header-meta"); ?>
-    <?php $index_template = true;?>
-    <body>
-        <div class="off-canvas-wrap" data-offcanvas>
-            <div class="inner-wrap">
-                <div id="page-wrapper">
-                    <?php
-                    include "sections/header.php"; 
-                    include "sections/off-canvas.php"; 
-                    if (is_front_page()) { 
-                        include "sections/front-page.php"; 
-                    } 
-                    if (is_home()) { 
-                        include "sections/blog-home.php";
-                    } 
-                    if (is_archive()) { 
-                        include "sections/blog-archive.php";
-                    } 
-                    if (is_single()) {
-                        include "sections/blog-single.php";
-                    }
-                    if (is_search()) { 
-                        include "sections/search.php";
-                    }
-                    if (is_page() && !is_front_page()) { 
-                        include "sections/interior-page.php"; 
-                    }
-                    include "sections/footer.php";  
-                    include "sections/copyright.php";  
-                    ?>
-                </div><!--/#page-wrapper-->
-                <a class="exit-off-canvas"></a>
-            </div><!--End of inner-wrap-->
-        </div><!--End of off-canvas-->
-        <?php wp_footer();?>
-        <script charset="utf-8" type="text/javascript">var switchTo5x=true;</script>
-        <script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
-        <script charset="utf-8" type="text/javascript">stLight.options({"publisher":"wp.c3d3647e-de70-4780-b71d-6b739fad685a"});var st_type="wordpress4.3.1";</script>
-    </body>
-</html>
\ No newline at end of file
index 39354d7..752c38c 100644 (file)
@@ -1,39 +1,26 @@
-<?php
-if ( !function_exists( 'glm_blocks_per_section' ) ) {
-    function glm_blocks_per_section( $section ) {
-        if ( function_exists( 'fetch_all_glm_blocks' ) ) {
-            $blocks = fetch_all_glm_blocks( PARTNERS_BLOCKS );
-            $count = 1;
-            ?>
-            <div class="blocks">
-                <?php foreach ($blocks as $block):?>
-                <div id="block-<?php echo $count; ?>" class="text-center small-12 medium-6 large-4 columns large-text-left block">
-                    <div class="block-content">
-                        <?php if($block->url):?>
-                        <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
-                        <?php endif;?>
-                        <?php echo get_the_post_thumbnail($block->ID, 'glm-block-image');?>
-                        <?php if($block->url):?>
-                        </a>
-                        <?php endif;?>
-                        <?php if($block->url):?>
-                        <a class="title-posts" href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
-                        <?php endif;?>
-                            <h3><?php echo $block->post_title;?></h3>
-                        <?php if($block->url):?>
-                        </a>
-                         <?php endif;?>
-                        <p><?php echo apply_filters('the_content', $block->post_content) . $block->post_excerpt;?></p>
-                        <?php if($block->url):?>
-                        <a class="blocks-readmore" href="<?php echo $block->url;?>"></a>
-                        <?php endif;?>
-                    </div>
-                        
-                </div>
-                <?php $count++; ?>
-                <?php endforeach;?>
-            </div>
-            <?php 
-        }
-    }
-}
+<?php if(function_exists('fetch_all_glm_blocks')):?>
+<?php $blocks = fetch_all_glm_blocks();?>
+<div class="blocks">
+    <?php foreach ($blocks as $block):?>
+    <div class="text-center small-centered small-12 medium-6 large-uncentered large-4 columns large-text-left blocks">
+            <?php if($block->url):?>
+            <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
+            <?php endif;?>
+            <?php echo $block->thumbnail;?>
+            <?php if($block->url):?>
+            </a>
+            <?php endif;?>
+            <?php if($block->url):?>
+            <a class="title-posts" href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
+            <?php endif;?>
+                <h2><?php echo $block->post_title;?></h2>
+            <?php if($block->url):?>
+            </a>
+             <?php endif;?>
+        <p><?php echo $block->post_content ;?></p>
+        <a class="blocks-readmore" href="<?php echo $block->url;?>">read more...</a>
+        <img class="text-center divide" src="<?php echo get_template_directory_uri(); ?>/assets/divider.png">
+    </div>
+    <?php endforeach;?>
+</div>
+<?php endif;?>
index c0bc38e..332b364 100644 (file)
@@ -1,7 +1,10 @@
                     <main class="page-front">
-                        <?php get_template_part('parts/slide-show');?>
                         <div id="content-wrapper">
-                            
+                            <div class="row">
+                                <?php
+                                get_template_part('parts/glm-blocks');
+                                ?>
+                            </div>
                             <div class="row">
                                 <div id="front-content" class="small-centered small-12 medium-7 columns">
                                     <div class="row">
index 20a10df..65b00b5 100644 (file)
 </div>
 <header class="main opensearchserver.ignore">
     <div class="row">
-        <div class="small-12 medium-9 columns text-center medium-text-left">
+        <div class="small-12 medium-8 columns text-center medium-text-left">
             <a class="logo" href="<?php bloginfo('url'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/assets/WherePeopleCountLogo.gif" alt="Where People Count: Accounting, Bookkeeping, & Payroll Services"></a>
         </div>
-        <div class="medium-3 columns show-for-medium-up">
+        <div class="medium-4 columns show-for-medium-up">
             <img class="right" src="<?php echo get_template_directory_uri(); ?>/assets/QuickBooks_Logos.gif">
         </div>
     </div>