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

Unchecking "Show Avatars" for comments also disables avatars for author boxes. #187

Closed
rmorabia opened this Issue Apr 4, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@rmorabia

rmorabia commented Apr 4, 2015

I'm back on Wordpress, which obviously means I'm using Independent Publisher.

Just found this bug.

Here it is working normally:
2015-04-04 14_40_46-

Here's the setting for unchecking Show Avatars (specifically specifies it's for comments only):
2015-04-04 14_41_22-

And upon unchecking, here's the same post:
2015-04-04 14_42_00-

@raamdev

This comment has been minimized.

Owner

raamdev commented Apr 4, 2015

@rmorabia Ah, thanks so much for reporting this!

I was about to mark this as a bug and tell you that I'll get it fixed for the next release, but after thinking about it for a moment I realized that the current functionality actually makes sense. Your avatar (i.e., your photo that shows up on posts that you've written), will be hidden if you disable avatars.

However, if you're running a single-author blog, then it probably makes more sense to use the Header Image (which shows up on the home page and non-Single pages), in place of the Avatar on Single pages so that you can disable Avatars but still see the author image.

I'll get this fixed for the next release!

Glad to see you back on WordPress. :-)

@raamdev raamdev added the bug label Apr 4, 2015

@raamdev raamdev added this to the Next Release milestone Apr 4, 2015

@raamdev raamdev self-assigned this Apr 4, 2015

@rmorabia

This comment has been minimized.

rmorabia commented Apr 5, 2015

Great! As always, thanks for the fast response.

@raamdev

This comment has been minimized.

Owner

raamdev commented May 22, 2015

@rmorabia This has been fixed in the latest development trunk and will go out with the next release. Note that "Enable Multi-Author Mode" must be unchecked for this to work, i.e., if you disable Show Avatars and also disable "Enable Multi-Author Mode", then the Header Image will always be used on Single Posts.

2015-05-22_19-29-44


Temporary Fix

If you want to get this working before the next release of the theme, you can add the following to your Child Theme functions.php file and it will override the Parent Theme version of this function:

    /**
     * Outputs post author info for display on single posts
     *
     * @since Independent Publisher 1.0
     */
    function independent_publisher_posted_author_card() {
        /**
         * This function gets called outside the loop (in header.php),
         * so we need to figure out the post author ID and Nice Name manually.
         */
        global $wp_query;
        $post_author_id = $wp_query->post->post_author;
        $show_avatars = get_option('show_avatars');
        ?>

        <?php if((!$show_avatars || $show_avatars === 0) && !independent_publisher_is_multi_author_mode() &&  get_header_image()) : ?>
            <a class="site-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
                <img class="no-grav" src="<?php echo esc_url( get_header_image() ); ?>" height="<?php echo absint( get_custom_header()->height ); ?>" width="<?php echo absint( get_custom_header()->width ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
            </a>
        <?php else: ?>
            <a class="site-logo" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID', $post_author_id ) ); ?>">
                <?php echo get_avatar( get_the_author_meta( 'ID', $post_author_id ), 100 ); ?>
            </a>
        <?php endif; ?>

        <h1 class="site-title"><?php independent_publisher_posted_author(); ?></h1>
        <h2 class="site-description"><?php the_author_meta( 'description', $post_author_id ) ?></h2>

        <?php get_template_part( 'menu', 'social' ); ?>

        <div class="site-published-separator"></div>
        <h2 class="site-published"><?php _e('Published', 'independent-publisher'); ?></h2>
        <h2 class="site-published-date"><?php independent_publisher_posted_on_date(); ?></h2>
        <?php /* Show last updated date if the post was modified AND
                    Show Updated Date on Single Posts option is enabled AND
                        'independent_publisher_hide_updated_date' Custom Field is not present on this post */ ?>
        <?php if ( get_the_modified_date() !== get_the_date() &&
                    independent_publisher_show_updated_date_on_single() &&
                        ! get_post_meta( get_the_ID(), 'independent_publisher_hide_updated_date', TRUE ) ) : ?>
            <h2 class="site-published"><?php _e('Updated', 'independent-publisher'); ?></h2>
            <h2 class="site-published-date"><?php independent_publisher_post_updated_date(); ?></h2>
        <?php endif; ?>

        <?php do_action( 'independent_publisher_after_post_published_date' ); ?>
    <?php
    }

@raamdev raamdev closed this May 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment