Skip to content

Commit

Permalink
Minor layout updates on team and author pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbohacek committed Jul 19, 2019
1 parent f6140c2 commit bf695fb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 39 deletions.
56 changes: 27 additions & 29 deletions author.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,43 +187,38 @@
' <img src="' . $bot_thumbnail_url . '" data-src="' . $bot_thumbnail_url . '" class="card-img-top lazy-load" >' .
' </a>' .
' <div class="card-body">' .
' <h5 class="card-title">' . $bot_title . '</h5>' .
' <h5 class="card-title">' .
' <a href="' . $bot_url . '" class="mb-0">' . $bot_title . '</a>' .
' </h5>' .
' <p class="card-text">' . $bot_description . '</p>' .
' </div>' .
' <div class="card-footer">' .
' <a href="' . $bot_url . '" class="btn mb-0">View bot</a>' .
( !empty( $bot_source_url ) ? '<a href="' . $bot_source_url . '" class="btn mb-0">View source</a>' : '' ) .
' </div>' .
' </div>' .
'</div>';
}
}

$bot_list_html .= '</div>';


$bot_list_html .= '</div>';
echo $bot_list_html;

?>
<?php
if ( count( $author_tags_bots ) ){ ?>
<h2 id="bot-tags">Bot tags</h2>
<p class="post-tags mt-5 mb-5"><?php
foreach ( $author_tags_bots as $tag ) {
$author_tags_bots_html[] = '<a href="' . $site_url . '/author/' . $username . '/?post_type=bot&tags=' . $tag . '">' . $tag . '</a> ';
}
echo join( ' ', $author_tags_bots_html );
?></p>
<?php } ?>
<a class="btn mt-2" href="<?php echo '/author/' . $username . '/?post_type=bot' ?>">View all bots</a>

<p class="post-tags mt-5 mb-5"><?php

foreach ( $author_tags_bots as $tag ) {
$author_tags_bots_html[] = '<a href="' . $site_url . '/author/' . $username . '/?post_type=bot&tags=' . $tag . '">' . $tag . '</a> ';
}

echo join( ' ', $author_tags_bots_html );
?></p>
<?php }
?>
<?php } ?>
<?php
global $wp_query;

$wp_query = new WP_Query( array(
'post_type' => 'resource',
'posts_per_page' => '5',
'posts_per_page' => '6',
'author' => $author_id,
'post_status' => 'publish',
'orderby' => 'publish_date',
Expand All @@ -247,16 +242,19 @@

get_template_part('loop');
?>
<a class="btn mt-2" href="<?php echo '/author/' . $username . '/?post_type=resource' ?>">View all resources</a>
<p class="post-tags mt-5 mb-5"><?php
foreach ( $author_tags_resources as $tag ) {
$author_tags_resources_html[] = '<a href="' . $site_url . '/author/' . $username . '/?post_type=resource&tags=' . $tag . '">' . $tag . '</a> ';
}
<?php
if ( count( $author_tags_resources ) ){ ?>
<h2 id="resource-tags">Resource tags</h2>
<p class="post-tags mt-5 mb-5"><?php
foreach ( $author_tags_resources as $tag ) {
$author_tags_resources_html[] = '<a href="' . $site_url . '/author/' . $username . '/?post_type=resource&tags=' . $tag . '">' . $tag . '</a> ';
}

echo join( ' ', $author_tags_resources_html );
?></p>
<?php }
?>
echo join( ' ', $author_tags_resources_html );
?></p>
<?php } ?>
<a class="btn mt-2" href="<?php echo '/author/' . $username . '/?post_type=resource' ?>">View all resources</a>
<?php } ?>
</div>
</main>

Expand Down
13 changes: 3 additions & 10 deletions template-team-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,23 @@
else{
$botwiki_team_role = "Botwiki contributor.";
}

// $website_url = esc_attr( get_the_author_meta( 'user_url', $author_id ) );
// $twitter_handle = str_replace('@', '', esc_attr( get_the_author_meta( 'twitter-handle', $author_id ) ) );

?>
<div class="col-sm-6 col-md-3 list-item">

<div class="card w-100">
<a href="<?php echo get_author_posts_url($author_id, $username ); ?>">
<img class="card-img-top" src="<?php echo str_replace('?s=96', '?s=512', get_avatar_url($author_id)); ?>" alt="<?php echo $full_name; ?>">
</a>
<div class="card-body">
<h5 class="card-title"><?php echo $nickname; ?></h5>
<h5 class="card-title">
<a href="<?php echo get_author_posts_url($author_id, $username ); ?>"><?php echo $nickname; ?></a>
</h5>
<p class="card-text"><?php echo $botwiki_team_role; ?></p>
</div>
<div class="card-footer text-muted">
<a href="<?php echo get_author_posts_url($author_id, $username ); ?>" class="btn btn-primary">View profile</a>
</div>
</div>
</div>


<?php } ?>

</div>
</div>
<?php
Expand Down

0 comments on commit bf695fb

Please sign in to comment.