diff --git a/web/app/themes/mitlib-news/archive-bibliotech.php b/web/app/themes/mitlib-news/archive-bibliotech.php new file mode 100644 index 00000000..8a110f31 --- /dev/null +++ b/web/app/themes/mitlib-news/archive-bibliotech.php @@ -0,0 +1,116 @@ + $charlength ) { + $subex = mb_substr( $excerpt, 0, $charlength - 5 ); + $exwords = explode( ' ', $subex ); + $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) ); + if ( $excut < 0 ) { + echo mb_substr( $subex, 0, $excut ); + } else { + return $subex; + } + echo '[...]' ; + } else { + return $excerpt; + } +} + + +?> + + +
+
+ +
+

+ ' . get_the_date() . '' ); + elseif ( is_month() ) : + printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '' ); + elseif ( is_year() ) : + printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '' ); + else : + _e( 'Archives', 'twentytwelve' ); + endif; + ?> +

+
+ +
+ +
+ + + + + +

+ +

+
+
+ +
+
+ term_id ) . '">' . $category[0]->cat_name . ''; +} +?> +    + + +
+
+ + + + + +
+ + +
+ +
+ + + + diff --git a/web/app/themes/mitlib-news/archive.php b/web/app/themes/mitlib-news/archive.php new file mode 100644 index 00000000..b385241d --- /dev/null +++ b/web/app/themes/mitlib-news/archive.php @@ -0,0 +1,159 @@ + + + + + + + + +
+
+ + + +
+
+ + + + +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + + + + + + + + <?php the_title(); ?> + + + + post_type ) { ?> +

+ +

+ +

+ +

+ + + + + + + + + + + + + + + +
+ cat_name . '" title="' . $category[0]->cat_name . '" href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . ''; + } + ?> + + + +
+
+
+ + + + + +
+ +
+
+ +
+ + + + + + 7 ) { + + get_template_part( 'inc/more-posts' ); + + } + ?> + + + + + +
+ diff --git a/web/app/themes/mitlib-news/author.php b/web/app/themes/mitlib-news/author.php new file mode 100644 index 00000000..4bd77a3d --- /dev/null +++ b/web/app/themes/mitlib-news/author.php @@ -0,0 +1,149 @@ + + + + + +
+ + +
+
+ + + +
+

' . get_the_author( '', false ) . '' ); ?>

+
+ + + + + + +
+
+ +
+
+

+

+
+
+ + + +
+ + + + + + + +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + + + + + + <?php the_title();?> + + + + post_type ) { ?> +

+ +

+ +

+ +

+ + + + + + + + + + + +
+ +
"; + echo "
 Bibliotech"; + } else { + $category = get_the_category(); + $rCat = count( $category ); + $r = rand( 0, $rCat -1 ); + echo '' . $category[ $r ]->cat_name . ''; + } ?> + + +
+
+
+ +
+ + + + + + + +
+ + + + +
+
+
+ +
+ diff --git a/web/app/themes/mitlib-news/category.php b/web/app/themes/mitlib-news/category.php new file mode 100644 index 00000000..1a5b3c75 --- /dev/null +++ b/web/app/themes/mitlib-news/category.php @@ -0,0 +1,91 @@ + + + + +
+ +
+
+ ' . 'Category: ' . '' . single_cat_title( '', false ) . '' . '' ); + } ?> + + + + + + + + + + + + +
+ +
+ + + +
+ + + + +
+ diff --git a/web/app/themes/mitlib-news/content-single.php b/web/app/themes/mitlib-news/content-single.php new file mode 100644 index 00000000..8bcc9718 --- /dev/null +++ b/web/app/themes/mitlib-news/content-single.php @@ -0,0 +1,82 @@ + + +
data-category="slug; ?>"> +
+ + New! + + ', '' ); ?> + + + +
+ +
+ + + Start date is ' . $date_start . '
'; + echo '
End date is ' . $date_end . '
'; + } ?> + + + format('d-m-Y'); + // Check for events. + if ( 'post' == $type_post && 1 == get_field( 'is_event' ) ) { ?> + +
Event date format( 'F, j Y' ); ?> starting at and ending at
+ + + + + +
+ + diff --git a/web/app/themes/mitlib-news/index.php b/web/app/themes/mitlib-news/index.php new file mode 100644 index 00000000..535a6b04 --- /dev/null +++ b/web/app/themes/mitlib-news/index.php @@ -0,0 +1,165 @@ +ID == $post->ID; + +/** + * The $post_count variable is used to record how many stories were loaded + * on the initial page load (since the number of sticky stories is variable). + * This is then passed to the pagination routine to ensure smooth progression + * from the first to second pages. + */ +$post_count = 0; + +get_header(); + +get_template_part( 'inc/sub-header' ); + +// This sets up the upper region of the list, for "Featured" posts. +?> +
+ + +
+ + +
+ +

Featured news

+ 7, + 'post__in' => $sticky, + 'post_type' => array( + 'spotlights', + 'bibliotech', + 'post', + ), + 'ignore_sticky_posts' => 1, + 'orderby' => 'post_date', + 'order' => 'DESC', + 'suppress_filters' => false, +); +$sticky_query = new WP_Query( $args ); + +if ( $sticky_query->have_posts() ) : + $i = 1; // $i is a counter variable. + while ( $sticky_query->have_posts() ) : + $sticky_query->the_post(); + + if ( 1 == $i ) { + // The first card is rendered as a feature. + renderMobileCard( $i, $post ); + renderFeatureCard( $i, $post ); + } else { + // All other cards are rendered normally. + renderRegularCard( $i, $post ); + } + + $i++; + $post_count++; + + endwhile; + + // This resets the query. + wp_reset_postdata(); + wp_reset_query(); + +endif; +?> +
+
+
+ +
+ + +
+ + +
+ + 9, + 'post__not_in' => $sticky, + 'post_type' => array( + 'spotlights', + 'bibliotech', + 'post', + ), + 'ignore_sticky_posts' => 1, + 'orderby' => 'post_date', + 'order' => 'DESC', + 'suppress_filters' => false, +); + +$standard_query = new WP_Query( $args ); + +if ( $standard_query->have_posts() ) : + // $theLength = $count_posts->publish; + $i = -1; + while ( $standard_query->have_posts() ) : + $standard_query->the_post(); + $i++; + renderRegularCard( $i, $post ); // --- CALLS REGULAR CARDS --- // + + $post_count++; + + endwhile; + + wp_reset_query(); // Restore global post data stomped by the_post(). + +endif; +?> +
+ + +
+ + + 6 ) { + get_template_part( 'inc/more-posts' ); +} //$i > 6 +?> + +
+ + + + + +
+ diff --git a/web/app/themes/mitlib-news/search.php b/web/app/themes/mitlib-news/search.php new file mode 100644 index 00000000..7a72d1b7 --- /dev/null +++ b/web/app/themes/mitlib-news/search.php @@ -0,0 +1,142 @@ + + +
+
+
+
+ + + + + + + + " . "Sorry, we didn't find anything matching your search. Please try a different search term." . '

' ; ?> + + + + + + + + + publish; + while ( have_posts() ) : the_post(); +$L++; + ?> + +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + + + + + + <?php the_title(); ?> + + + + post_type ) { ?> +

+ +

+ +

+ +

+ + + + + + + + + + + +
+ +
"; + echo "
 Bibliotech"; ?> + + + +
+ + cat_name . '" title="' . $category[ $r ]->cat_name . '" href="' . get_category_link( $category[ $r ]->term_id ) . '">' . $category[ $r ]->cat_name . ''; ?> + + + +
+ +
+
+ +
+ + + + +
+
+ + 7 ) { + + get_template_part( 'inc/more-posts' ); + + } ?> + + + + + + +
+ + + +
+ diff --git a/web/app/themes/mitlib-news/searchform.php b/web/app/themes/mitlib-news/searchform.php new file mode 100644 index 00000000..78910b30 --- /dev/null +++ b/web/app/themes/mitlib-news/searchform.php @@ -0,0 +1,27 @@ + + + + + diff --git a/web/app/themes/mitlib-news/sidebar.php b/web/app/themes/mitlib-news/sidebar.php new file mode 100644 index 00000000..622d5c75 --- /dev/null +++ b/web/app/themes/mitlib-news/sidebar.php @@ -0,0 +1,17 @@ + + + diff --git a/web/app/themes/mitlib-news/single.php b/web/app/themes/mitlib-news/single.php new file mode 100644 index 00000000..f775f7cf --- /dev/null +++ b/web/app/themes/mitlib-news/single.php @@ -0,0 +1,217 @@ + + + + + + + + +
+
+
+
+ +
data-category="slug; ?>"> +
+ ', '' ); ?> + +

+ + + +
+
+ +
+ +
+ + + + + +
+ Event date + + + + + + + + + + + format( 'F j, Y' ); ?> + + + + + + +
+ + + For more about this event, please visit ' . esc_url( $calendar_url ) . ''; + } + ?> + + + + + + + + + + + + + + + + + Start date is ' . $date_start . '
'; + echo '
End date is ' . $date_end . '
'; + } ?> +
+ +
+
+ +
+
+
+ +
+
More in cat_name . '" title="' . $category[ $r ]->cat_name . '" href="' . get_category_link( $category[ $r ]->term_id ) . '">' . $category[ $r ]->cat_name . ''; ?> +
+
+ + + + cat_name; +$currentPost = get_the_ID(); + + +$myCatId = $category[ $r ]->cat_ID; + +$args = array( + 'post_type' => array( 'post', 'bibliotech', 'spotlights' ), + 'cat' => $myCatId, + 'posts_per_page' => '3', + 'order' => 'DESC', + 'orderby' => 'date', + 'post__not_in' => array( $currentPost ), +); + ?> + + +
+ + + + + +
+ + +
+ + +
+
+
+ diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-archives.php b/web/app/themes/mitlib-news/templates/additionalPosts-archives.php new file mode 100644 index 00000000..ec536f00 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-archives.php @@ -0,0 +1,123 @@ + + + + + array( 'bibliotech' ), + 'post__not_in' => array( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'offset' => 10, + 'posts_per_page' => $limit, + 'order' => 'DESC', + 'orderby' => 'date', + 'suppress_filters' => false, + + +); + $the_query = new WP_Query( $args ); + + +?> +
+ + + post_count; +?> + + + + + + + + +have_posts() ) : ?> + +have_posts() ) : $the_query->the_post(); +$theLength = $my_query->post_count; +$i++; +?> + + +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + + <?php the_title(); ?> + + + +

+ +

+ + + + + + + + + + + + + +
+ cat_name . '" title="' . $category[ $r ]->cat_name . '" href="' . get_category_link( $category[ $r ]->term_id ) . '">' . $category[ $r ]->cat_name . ''; + ?> + + +
+
+
+ + + +
diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-biblio.php b/web/app/themes/mitlib-news/templates/additionalPosts-biblio.php new file mode 100644 index 00000000..de5feb29 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-biblio.php @@ -0,0 +1,82 @@ + + + + + array( 'bibliotech' ), + 'post__not_in' => array( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'offset' => 10, + 'posts_per_page' => $limit, + 'order' => 'DESC', + 'orderby' => 'date', + 'suppress_filters' => false, + + +); + $the_query = new WP_Query( $args ); + + +?> + + + post_count; +?> + + + + + + + + +have_posts() ) : ?> + +have_posts() ) : $the_query->the_post(); +$theLength = $my_query->post_count; +$i++; +?> + + + + + + diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-cat.php b/web/app/themes/mitlib-news/templates/additionalPosts-cat.php new file mode 100644 index 00000000..bffe6438 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-cat.php @@ -0,0 +1,95 @@ + + + + + + $limit, + 'post_type' => 'post', + 'cat' => $categoryId, + 'offset' => 21, + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'orderby' => 'date', + 'order' => 'DESC', + 'suppress_filters' => false, + +); + +$the_query = new WP_Query( $args ); + +// Removes button start. +$ajaxLength = $the_query->post_count; +?> + + + + +have_posts() ) : ?> + + +have_posts() ) : $the_query->the_post(); + $o++; + renderRegularCard( $o, $post ); // --- CALLS REGULAR CARDS --- // +?> + + + + + + + + + + + diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-events.php b/web/app/themes/mitlib-news/templates/additionalPosts-events.php new file mode 100644 index 00000000..5d669b7a --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-events.php @@ -0,0 +1,87 @@ + + + + + $limit, + 'ignore_sticky_posts' => true, + 'offset' => 9, + + 'post_type' => 'post', + 'meta_query' => array( + array( + 'key' => 'is_event', + 'value' => '1', + 'compare' => '=', + ), + array( + 'key' => 'event_date', + 'value' => date( 'Y-m-d' ), + 'compare' => '<', + 'type' => 'DATE', + ), + ), + + 'meta_key' => 'event_date', + 'orderby' => array( + 'meta_value_num' => 'DESC', + ), + +); + + $the_query = new WP_Query( $args ); + +// Removes button start. +$ajaxLength = $the_query->post_count; + +if ( $ajaxLength < $limit ) { +?> + +have_posts() ) : + $o = -1; + while ( $the_query->have_posts() ) : $the_query->the_post(); + $o++; + renderEventCard( $o, $post ); + endwhile; +endif; + +wp_reset_query(); // Restore global post data stomped by the_post(). + +?> diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-news.php b/web/app/themes/mitlib-news/templates/additionalPosts-news.php new file mode 100644 index 00000000..4c4b394d --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-news.php @@ -0,0 +1,69 @@ + + + + + + 'post', + 'post__not_in' => array( $sticky ), + 'posts_per_page' => $limit, + 'offset' => '10', + 'ignore_sticky_posts' => true, + 'order' => 'DESC', + 'orderby' => 'date', + 'meta_query' => array( + array( + 'key' => 'is_event', + 'value' => '1', + 'compare' => '!=', + 'type' => 'NUMERIC', + ), + ), + + ); + + $the_query = new WP_Query( $args2 ); + ?> + + + have_posts() ) : ?> + have_posts() ) : $the_query->the_post(); ?> + + + + + + + diff --git a/web/app/themes/mitlib-news/templates/additionalPosts-search.php b/web/app/themes/mitlib-news/templates/additionalPosts-search.php new file mode 100644 index 00000000..f126d70e --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts-search.php @@ -0,0 +1,148 @@ + + +set( 'is_search', true ); +} + +?> + + + $limit, +); + +foreach ( $query_args as $key => $string ) { + $query_split = explode( '=', $string ); + $search_args[ $query_split[0] ] = urldecode( $query_split[1] ); + if ( 'search' == $query_split[0] ) { + $search_args['s'] = urldecode( $query_split[1] ); + } +} // foreach + +$the_query = new WP_Query( $search_args ); +// The set_search() function is defined above. +set_search( $the_query ); + + +// Removes button start. +$ajaxLength = $the_query->post_count; +?> + + + + + + +have_posts() ) : ?> + + +have_posts() ) : $the_query->the_post(); + $o++; +?> + + +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + + + + <?php the_title(); ?> + + + +

+ +

+ + + + + + + + + + +
+ +
"; + echo "
 Bibliotech"; ?> + + + +
+
+ cat_name . '" title="' . $category[ $r ]->cat_name . '" href="' . get_category_link( $category[ $r ]->term_id ) . '">' . $category[ $r ]->cat_name . ''; ?> + + + +
+ + + +
+
+ + + + + diff --git a/web/app/themes/mitlib-news/templates/additionalPosts.php b/web/app/themes/mitlib-news/templates/additionalPosts.php new file mode 100644 index 00000000..bcccf96e --- /dev/null +++ b/web/app/themes/mitlib-news/templates/additionalPosts.php @@ -0,0 +1,88 @@ + + + + + $limit, + 'post_type' => array( 'spotlights','bibliotech', 'post' ), + 'offset' => $offset, + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'orderby' => 'date', + 'order' => 'DESC', + 'suppress_filters' => false, + +); + +$the_query = new WP_Query( $args ); + + +?> +post_count; +?> + + + + + + +have_posts() ) : ?> + + +have_posts() ) : $the_query->the_post(); +renderRegularCard( $o, $post ); +$o++; +?> + + + + + + + + + diff --git a/web/app/themes/mitlib-news/templates/page-biblio-archive.php b/web/app/themes/mitlib-news/templates/page-biblio-archive.php new file mode 100644 index 00000000..7223c4ec --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-biblio-archive.php @@ -0,0 +1,69 @@ + +
+
+
+ + + +
+ ', '' ); + if ( get_field( 'subtitle' ) ) { ?> +

+ +
+ +
+ +

+
+ +
+
+
+ + +

+ + +
+
+
+
+ diff --git a/web/app/themes/mitlib-news/templates/page-bibliotech.php b/web/app/themes/mitlib-news/templates/page-bibliotech.php new file mode 100644 index 00000000..a0b44abd --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-bibliotech.php @@ -0,0 +1,124 @@ +ID == $post->ID; +get_header(); ?> + + + + +
+ + +
+ 1, + 'post__in' => $sticky, + 'ignore_sticky_posts' => 1, + 'post_type' => 'bibliotech', + 'order' => 'DESC', + 'orderby' => 'date', + 'suppress_filters' => false, +); +$query2 = new WP_Query( $args ); +if ( $query2->have_posts() ) : +while ( $query2->have_posts() ) : $query2->the_post(); ?> + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + 9, + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'post_type' => 'bibliotech', + 'orderby' => 'date', + 'order' => 'DESC', + 'suppress_filters' => false, + ); +$my_query = new WP_Query( $args ); +$m = -1; +// Getting length. +$theLength = $my_query->post_count; +while ( $my_query->have_posts() ) { +$m++; +$my_query->the_post(); +?> + + + + +
+ + 8 ) { + + get_template_part( 'inc/more-posts' ); + + } ?> +
+ +
+ diff --git a/web/app/themes/mitlib-news/templates/page-events.php b/web/app/themes/mitlib-news/templates/page-events.php new file mode 100644 index 00000000..dc4dd521 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-events.php @@ -0,0 +1,182 @@ +ID == $post->ID; +get_header(); ?> + + + +
+ + -1, + 'ignore_sticky_posts' => true, + + 'post_type' => 'post', + 'meta_query' => array( + array( + 'key' => 'is_event', + 'value' => '1', + 'compare' => '=', + ), + array( + 'key' => 'event_date', + 'value' => date( 'Y-m-d' ), + 'compare' => '>=', + 'type' => 'DATE', + ), + ), + + 'meta_key' => 'event_date', + 'orderby' => array( + 'meta_value_num' => 'ASC', + ), + +); +$the_future = new WP_Query( $future ); +$future_posts = (array) $the_future->posts; + +$past = array( + + 'posts_per_page' => 9, + 'ignore_sticky_posts' => true, + + 'post_type' => 'post', + 'meta_query' => array( + array( + 'key' => 'is_event', + 'value' => '1', + 'compare' => '=', + ), + array( + 'key' => 'event_date', + 'value' => date( 'Y-m-d' ), + 'compare' => '<', + 'type' => 'DATE', + ), + ), + + 'meta_key' => 'event_date', + 'orderby' => array( + 'meta_value_num' => 'DESC', + ), + +); + +$the_past = new WP_Query( $past ); +$past_posts = (array) $the_past->posts; + +// Archived events tagged by "oldevents". +$archive = array( + + 'posts_per_page' => 9, + 'ignore_sticky_posts' => true, + + 'post_type' => 'post', + 'tag' => 'oldevents', + + 'orderby' => 'post_date', + +); +$the_archive = new WP_Query( $archive ); +$archive_posts = (array) $the_archive->posts; + +?> +
+

Upcoming classes & events

+ 0 ) { + $i = -1; + foreach ( $future_posts as $post ) { + $i++; + renderEventCard( $i, $post ); + } + } else { + ?> +

There are no upcoming classes or events at this time, but check back often.

+ +
+ + + +

Past classes & events

+
+ 0 ) { + $i = -1; + foreach ( $past_posts as $post ) { + $i++; + renderEventCard( $i, $post ); + } + } + ?> +
+ 8 ) { + get_template_part( 'inc/more-posts' ); + } ?> + + + +
+ + + + + + + +
+ID == $post->ID; +get_header(); ?> + $charlength ) { + $subex = mb_substr( $excerpt, 0, $charlength - 5 ); + $exwords = explode( ' ', $subex ); + $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) ); + if ( $excut < 0 ) { + echo mb_substr( $subex, 0, $excut ); + } else { + return $subex; + } + echo '[...]' ; + } else { + return $excerpt; + } +} + +?> + + +
+
+
+ array( + + array( + + 'column' => 'post_date_gmt', + 'before' => '210 days ago', + + ), + array( + + 'column' => 'post_date_gmt', + 'after' => 'last year', + + ), + ), +); + +$the_query = new WP_Query( $args ); + + +?> + +
+ have_posts() ) : ?> + have_posts() ) : $the_query->the_post(); ?> +
+ + + + + +

+ +

+
+
+ +
+ +
     + + + +
+ + + + +
+ term_id ) . '">' . $category[0]->cat_name . ''; + } + ?> +   
+
+ + + + +

+ +

+ + + +
+ +
+ +
+ +
+ +
+ diff --git a/web/app/themes/mitlib-news/templates/page-news.php b/web/app/themes/mitlib-news/templates/page-news.php new file mode 100644 index 00000000..4ef84120 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-news.php @@ -0,0 +1,115 @@ +ID == $post->ID; +get_header(); ?> + + + + + + +
+ + +
+ +

News

+ + 'post', + 'post__not_in' => array( $sticky ), + 'posts_per_page' => '9', + 'ignore_sticky_posts' => true, + 'order' => 'DESC', + 'orderby' => 'date', + 'meta_query' => array( + array( + 'key' => 'is_event', + 'value' => '1', + 'compare' => '!=', + 'type' => 'NUMERIC', + ), + ), + + ); + $the_query = new WP_Query( $args ); + ?> + have_posts() ) : + // $theLength = $count_posts->publish; + ?> + + + have_posts() ) : + $the_query->the_post(); + $i++; + renderRegularCard( $i, $post ); // --- CALLS REGULAR CARDS --- // + ?> + + + + + + + + + + +
+ + +
+ + + 6 ) { + get_template_part( 'inc/more-posts' ); + } + ?> + + + + + +
+ diff --git a/web/app/themes/mitlib-news/templates/page-sidebar.php b/web/app/themes/mitlib-news/templates/page-sidebar.php new file mode 100644 index 00000000..5e8d5c97 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-sidebar.php @@ -0,0 +1,49 @@ + + + + +
+
+
+ + +
+ +
+ +
+ +
+ +

+ +
+ + + +
+ +
+ + + +
+ + + +
+ +
+
+ diff --git a/web/app/themes/mitlib-news/templates/page-subscribe.php b/web/app/themes/mitlib-news/templates/page-subscribe.php new file mode 100644 index 00000000..a90919c2 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page-subscribe.php @@ -0,0 +1,106 @@ +ID == $post->ID; + + + +get_header(); ?> +
+
+
+ + +

News & events

+ + +

News & events + ' . ': ' . single_cat_title( '', false ) . '' ); + } ?> +

+ + + +
+ + + + + +
+
+
+
+ + + + +
+
+ + + + +
+ +
+ +

post_title; ?>

+ +

post_title; ?>

+ +
+ + + + +
+ + +
+ + + +
+ +

+ + + +
+ + + +
+ + +
+ + + + + + + +
+
+
+ +
+ diff --git a/web/app/themes/mitlib-news/templates/page.php b/web/app/themes/mitlib-news/templates/page.php new file mode 100644 index 00000000..ad8fad32 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/page.php @@ -0,0 +1,82 @@ +ID == $post->ID; + + + +get_header(); ?> + + + +
+
+ +
+
+ +
+ diff --git a/web/app/themes/mitlib-news/templates/rss-biblio.php b/web/app/themes/mitlib-news/templates/rss-biblio.php new file mode 100644 index 00000000..1c94edfc --- /dev/null +++ b/web/app/themes/mitlib-news/templates/rss-biblio.php @@ -0,0 +1,77 @@ + $length ) { + return (preg_match( '/^(.*)\W.*$/', substr( $string, 0, $length + 1 ), $matches ) ? $matches[1] : substr( $string, 0, $length )) . $replacer; } + return $string; +} + + + +$args = array( + 'posts_per_page' => -1, + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'post_type' => 'bibliotech', + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'suppress_filters' => false, + ); +$the_query = new WP_Query( $args ); +$lastpost = $numposts - 1; +header( 'Content-Type: application/rss+xml; charset=UTF-8' ); +echo ''; +?> + + + + MIT Libraries Bibliotech + //libraries.mit.edu/news/bibliotech-feed/ + Newsletter published by the MIT Libraries + en-us + post_date_gmt ) ); ?> + post_date_gmt ) ); ?> + hartman@mit.edu (Stephanie Hartman) +have_posts() ) : $the_query->the_post(); ?> + + + <?php echo get_the_title( $post->ID ); ?> + ID ); ?> + post_content, 500 ) . '

Keep on reading: ' . get_the_title( $post->ID ) . '' . ']]>'; ?>
+ post_date_gmt ) ); ?> + ID ); ?> +
+ +
+
diff --git a/web/app/themes/mitlib-news/templates/rss-event.php b/web/app/themes/mitlib-news/templates/rss-event.php new file mode 100644 index 00000000..2d328ca6 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/rss-event.php @@ -0,0 +1,78 @@ + $length ) { + return (preg_match( '/^(.*)\W.*$/', substr( $string, 0, $length + 1 ), $matches ) ? $matches[1] : substr( $string, 0, $length )) . $replacer; } + return $string; +} + + + +$args = array( + 'post__not_in' => get_option( 'sticky_posts' ), + 'meta_key' => 'is_event', + 'orderby' => 'meta_value_num', + 'order' => 'DESC', + 'posts_per_page' => -1, + + +); +$the_query = new WP_Query( $args ); +$lastpost = $numposts - 1; +header( 'Content-Type: application/rss+xml; charset=UTF-8' ); +echo ''; +?> + + + + MIT Libraries Events + //libraries.mit.edu/news/events/ + The latest events from the MIT Libraries + en-us + post_date_gmt ) ); ?> + post_date_gmt ) ); ?> + hartman@mit.edu (Stephanie Hartman) +have_posts() ) : $the_query->the_post(); ?> + + + <?php echo get_the_title( $post->ID ); ?> + ID ); ?> + post_content, 500 ) . '

Keep on reading: ' . get_the_title( $post->ID ) . '' . ']]>'; ?>
+ post_date_gmt ) ); ?> + ID ); ?> +
+ +
+
diff --git a/web/app/themes/mitlib-news/templates/test-template.php b/web/app/themes/mitlib-news/templates/test-template.php new file mode 100644 index 00000000..6e821581 --- /dev/null +++ b/web/app/themes/mitlib-news/templates/test-template.php @@ -0,0 +1,340 @@ + + + + + + +
+
+ + 1, + 'post__in' => $sticky, + 'ignore_sticky_posts' => 1, + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'suppress_filters' => false, +); +$query2 = new WP_Query( $args ); +if ( $query2->have_posts() ) : + while ( $query2->have_posts() ) : $query2->the_post(); ?> + + +
+
+ + <?php the_title(); ?> +
+
+

+ + +
     + + + +
+ + + + + +
+

+ +

+
+
+ cat_name . '" href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . ''; +} +?> +    + + +
+
+
+ + + + + + + + + + +
+ + + + 9, + 'post_type' => array( 'Spotlights','bibliotech', 'post' ), + 'post__not_in' => get_option( 'sticky_posts' ), + 'ignore_sticky_posts' => 1, + 'orderby' => 'menu_order', + 'order' => 'ASC', + 'suppress_filters' => false, + +); +$the_query = new WP_Query( $args ); + + +?> + + + + + + +
+ have_posts() ) : ?> + have_posts() ) : $the_query->the_post(); + + + ?> +
+
post_type ) { the_field( 'external_link' ); +} else { echo get_post_permalink();} ?>"'> + post_type ) { ?> +
Featured collection
+ + post_type ) { ?> +
featured
+ + +
+ + + <?php the_title(); ?> +

+ + +
format( 'F, j Y' ); ?>     + + + +
+ + + +
+

+ = 50) && has_excerpt( $post->ID ) ) { + echo excerpt( 30 ); + echo 'excertp greater then'; + + + } + + + ?> + + +

+
+ + + + + + +

+ + +
format( 'F, j Y' ); ?>     + + + +
+ + + +
+

+ +

+
+ + + + +

+ + + + + +
+ + format( 'F, j Y' ); ?>     + + + +
+ + + + + + +
+

+ +

+
+ + + +
+ + bilbiotech icon
"; + echo "
 Bibliotech"; + + + } else { + + + + $category = get_the_category(); + + + $rCat = count( $category ); + $r = rand( 0, $rCat -1 ); + echo '' . $category[ $r ]->cat_name . ''; + + } + ?> + + +
+
+
+ + +
+ + + + + + + + + +
+
+ +
+
+ + +
+ +
+
+ + +