Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author name on main page #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Hax/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ function mozhacks_admin_init(){

// Render the Social Sharing checkbox on the settings page
function mozhacks_settings_field_share_posts() {
?>
<div class="layout share-posts">
<label>
<input type="checkbox" id="mozhacks_share_posts" name="mozhacks_share_posts" value="1" <?php checked( '1', get_option('mozhacks_share_posts') ); ?> />
<span>
<?php _e('Add social sharing buttons to posts and pages', 'mozhacks'); ?>
</span>
</label>
</div>
<?php
?>
<div class="layout share-posts">
<label>
<input type="checkbox" id="mozhacks_share_posts" name="mozhacks_share_posts" value="1" <?php checked( '1', get_option('mozhacks_share_posts') ); ?> />
<span>
<?php _e('Add social sharing buttons to posts and pages', 'mozhacks'); ?>
</span>
</label>
</div>
<?php
}

// Renders the Twitter account setting field to share via.
Expand Down Expand Up @@ -323,8 +323,8 @@ function fc_honeypot( array $data ){
wp_die( $message, $title, $args );
exit(0);
} else {
return $data;
}
return $data;
}
}
add_filter('preprocess_comment','fc_honeypot');

Expand Down Expand Up @@ -879,7 +879,7 @@ function fc_custom_loop($args) {
If 'post__in' is in args and 'orderby' is set to 'none', just grab those posts,
in the order provided in the 'post__in' array.
*/
if($loop_orderby && $loop_orderby == 'none' && $loop_post__in)
if(isset($loop_orderby) && $loop_orderby == 'none' && $loop_post__in)
{
foreach($loop_post__in as $post_id)
$loop_posts[] = get_post($post_id);
Expand Down
4 changes: 2 additions & 2 deletions Hax/single.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<h1 class="post__title"><?php the_title(); ?></h1>
<div class="byline">
<h3 class="post__author">
<?php if (function_exists(coauthors)) : ?>
<?php if (function_exists('coauthors')) : ?>
<?php
$authors = get_coauthors($post->ID);
$authorPos = 0;
Expand Down Expand Up @@ -76,7 +76,7 @@
<article class="post" role="article">
<?php the_content(); ?>
<section class="about">
<?php if (function_exists(coauthors)) : ?>
<?php if (function_exists('coauthors')) : ?>
<?php $authors = get_coauthors($post->ID); ?>
<?php foreach ($authors as $author) : ?>
<h2 class="about__header">About
Expand Down
20 changes: 18 additions & 2 deletions Hax/views/article-list.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<li class="list-item row listing">
<?php $authors = get_coauthors($post->ID); ?>
<?php echo get_avatar($authors[0], 72) ?>
<?php
$authors = get_coauthors($post->ID);
?>
<a href="<?php echo get_author_posts_url($authors[0]->ID); ?>" title="<?php echo $authors[0]->display_name; ?>">
<?php echo get_avatar($authors[0], 72) ?>
</a>
<?php
$author_names = [];
foreach($authors as $author)
{
$author_names[] = $author->display_name;
}
$authors = implode($author_names, ',');
?>
<div class="block block--1">
<h3 class="post__title">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
Expand All @@ -11,6 +23,10 @@
<abbr class="published" title="<?php the_time('Y-m-d\TH:i:sP'); ?>">
<?php the_time(get_option('date_format')); ?>
</abbr>
&nbsp;by
<abbr title="<?php echo $authors ?>">
<?php echo $authors ?>
</abbr>
</div>
</div>
</li>