Skip to content

Commit

Permalink
Merge pull request #40 from thenewinquiry/0.6.0-subscriber-content
Browse files Browse the repository at this point in the history
0.6.0 subscriber content
  • Loading branch information
frnsys committed Apr 16, 2017
2 parents 07abc03 + 47591b3 commit fdbbee4
Show file tree
Hide file tree
Showing 19 changed files with 323 additions and 136 deletions.
2 changes: 1 addition & 1 deletion css/style.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.min.css.map

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions images/download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ function tni_nav_class( $classes, $item ){
}
add_filter( 'nav_menu_css_class' , 'tni_nav_class' , 10 , 2 );

/**
* Toggle menu items based on authentication
*
* @since 0.5.2
*/
function tni_toggle_auth_menu_items( $items, $menu, $args ) {
if( !is_admin() ) {
$auth = tni_core_check_auth();
foreach ( $items as $key => $item ) {
if ( in_array( 'js-login', $item->classes ) && $auth ) {
unset( $items[$key] );
} else if ( in_array( 'subscribe', $item->classes ) && $auth) {
unset( $items[$key] );
} else if ( in_array( 'js-logout', $item->classes ) && !$auth) {
unset( $items[$key] );
} else if ( in_array( 'my-library', $item->classes ) && !$auth) {
unset( $items[$key] );
}
}
}
return $items;
}
add_filter( 'wp_get_nav_menu_items', 'tni_toggle_auth_menu_items', 10, 2 );

/**
* Modify Image Markup
* When image is inserted into post content without a caption, alter markup produced
Expand Down
13 changes: 9 additions & 4 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ function tni_the_magazine_pdf( $post_id = null ) {

if( $post_meta ) {
$url = wp_get_attachment_url( intval( $post_meta ) );
$output = sprintf( '<a href="%s" title="%s" class="download-link">%s</a>',
$output = sprintf( '<a href="%s" title="%s" class="download-link">%s %s</a>',
esc_url( $url ),
__( 'Download Issue', 'tni' ),
__( 'Download PDF', 'tni' )
__( 'Download PDF', 'tni' ),
'<img src="' . get_stylesheet_directory_uri() . '/images/download.svg">'
);
echo $output;
}
Expand All @@ -208,7 +209,7 @@ function tni_the_magazine_pdf( $post_id = null ) {
* @param int $post_id
* @return void
*/
function tni_the_magazine_toc( $post_id = null ) {
function tni_the_magazine_toc( $post_id = null , $auth = false) {
$post_id = ( $post_id ) ? (int) $post_id : get_the_id();
$posts = get_post_meta( $post_id, 'related_articles', true );

Expand All @@ -220,7 +221,11 @@ function tni_the_magazine_toc( $post_id = null ) {
foreach( $posts as $post ) {
setup_postdata( $post );

get_template_part( 'template-parts/content', 'magazine-article' );
if ( $auth ) {
get_template_part( 'template-parts/content', 'magazine-article-subscribed' );
} else {
get_template_part( 'template-parts/content', 'magazine-article' );
}

}
echo '</ul>';
Expand Down
30 changes: 30 additions & 0 deletions page-about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* The template for displaying the About page.
*
* @package Gridbox
*/

get_header();
?>

<section id="primary" class="content-single content-area content-about">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'page' );
endwhile; ?>

<h3 class="about-page-title"><?php _e('Editorial Board', 'tni'); ?></h3>
<?php tni_core_editors_by_title(); ?>

<h3 class="about-page-title"><?php _e('Contributors', 'tni'); ?></h3>
<ul class="about-contributors">
<?php coauthors_wp_list_authors(); ?>
</ul>
</main>
</section>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Custom theme for The New Inquiry, based on Gridbox theme.
* Add subscriber content
* Added `tni_the_magazine_pdf()` template tag

== 0.5.1 April 15, 2017 =
* Updated styles for images on single posts
* Changed header thumbnail for single posts

== 0.5.0 April 11, 2017 =
* Add Co-authors Plus support - `gridbox_entry_meta()` template tag will use coauthor plus function if it is active

Expand Down
10 changes: 5 additions & 5 deletions src/sass/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
.header-main {
display: flex;
flex-wrap: wrap;
padding-top: .5em;
padding-bottom: .5em;
padding-top: .2em;
padding-bottom: .2em;

justify-content: space-between;
align-items: center;
Expand Down Expand Up @@ -234,9 +234,9 @@
font-size: 1.2em;
}

@include breakpoint(md) {
font-size: 2em;
}
@include breakpoint(md) {
font-size: 1.2em;
}
}

.custom-logo {
Expand Down
4 changes: 4 additions & 0 deletions src/sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@
.post-layout-four-columns .post-wrapper .post-featured {
width: 100%;
}

.login-modal {
z-index: 100;
}
14 changes: 12 additions & 2 deletions src/sass/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@ nav ul {
text-decoration: none;
border-bottom: 3px solid $color__black;
}
&.current-menu-item.highlight > a {
border-bottom: none;
}

&:first-child a {
padding-left: 0;
}

&.subscribe a {
&.highlight a {
font-size: 13px;
font-weight: bold;
font-weight: 700;
}

&.my-library a {
background: $color__highlight-alt;
&:hover {
background: darken( $color__highlight-alt, 10% );
}
}
}

Expand Down
43 changes: 31 additions & 12 deletions src/sass/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,46 @@
font-family: $font__sans-serif;
font-weight: 300;
font-size: 1.2em;

h3 {
border-bottom: 1px solid $color__gray-light;
font-family: $font__sans-serif;
color: $color__text-light;
font-size: 14px;
letter-spacing: 1.2px;
line-height: 1.5em;
font-weight: 300;
text-transform: uppercase;
}

}

.entry-header {
margin-bottom: 2em;
}
}

.page .entry-content h3,
.about-page-title {
border-bottom: 1px solid $color__gray-light;
font-family: $font__sans-serif;
color: $color__text-light;
font-size: 14px;
letter-spacing: 1.2px;
line-height: 1.5em;
font-weight: 300;
text-transform: uppercase;
}

.page-title {
font-size: 1.6em;
font-family: $font__sans-serif;
text-transform: uppercase;
}

.editorial-title {
font-weight: bold;
font-family: $font__sans-serif;
font-size: 1.2em;
margin-bottom: 0.4em;
}
.content-about {
ul {
list-style-type: none;
padding: 0;
font-weight: 300;
font-size: 1.5em;
text-transform: uppercase;
}
.about-contributors {
font-size: 1em;
}
}
Loading

0 comments on commit fdbbee4

Please sign in to comment.