[Plugin: WP Biographia] Multiple Author Boxes are showing up
-
Hi I am using a slider component on a post
that basically has a picture and some text in front.
For some reason, an author box is showing up on the slider?
It only shows up when I select text at the bottom?The author box is still showing up properly at the bottom of the post.
I am using slidedeck for the slider.
Why would the box show up multiple times?
paul
-
Hi …
Without knowing what theme you’re using, what the slider component is doing and whether the theme and/or slider is using post content or post excerpts it’s almost impossible for me to even take a guess at this.
Could you provide a bit more detail?
-Gary
Haven’t heard anything back on this for 4 weeks now so I’m assuming you’ve sorted it and I’m flagging this as resolved. Feel free to reopen this thread if it’s still an ongoing issue.
-Gary
I have multi-author articles…I want to show 2 bio boxes….currently there is only one appearing…
How do I show two?
I am using Co-Authors
So Co Authors Plus (which is what I’m assuming you’re using as Co Authors looks to be unmaintained these days) provides a
get_coauthors
template tag that you can use. I can look at building support for this into a future release but that won’t be for a while as I have other code projects that got put on the back burner whilst I got the last version of WP Biographia out.For now, you can do a work-around in your template files by using the
get_coauthors
template tag along the lines of the following …<?php if (function_exists('get_coauthors')) { $coauthors = get_coauthors (); if ($coauthors && !empty($coauthors)) { foreach ($coauthors as $author_id) { $mode = 'raw'; wpb_the_biography_box ($mode, $author_id); } // end-foreach } } // end-get_coauthors-check ?>
… note that I’ve not tested this and this assumes that a) you want the Biography Box to work in raw mode (see the plugin’s docs for an explanation of raw vs. configured mode) and b) that you want to emit the Biography Box immediately (cf:
wpb_get_biography_box
if you want to store the Biography Box HTML for later use).-Gary
I am getting server errors as I try to put the code into functions.php…..I tried a few other changes to the beginning and end of code…
since it is in the middle of my functions file, I assumed that I only use:
if (function_exists(‘get_coauthors’)) {
$coauthors = get_coauthors ();
if ($coauthors && !empty($coauthors)) {
foreach ($coauthors as $author_id) {
$mode = ‘raw’;
wpb_the_biography_box ($mode, $author_id);
} // end-foreach
}
} // end-get_coauthors-checkWhat am I doing wrong?
I am getting server errors as I try to put the code into functions.php…..I tried a few other changes to the beginning and end of code…
since it is in the middle of my functions file, I assumed that I only use:
if (function_exists('get_coauthors')) { $coauthors = get_coauthors (); if ($coauthors && !empty($coauthors)) { foreach ($coauthors as $author_id) { $mode = 'raw'; wpb_the_biography_box ($mode, $author_id); } // end-foreach } } // end-get_coauthors-check
What am I doing wrong?
Please disregard that last message….I am new to this….I copied and pasted the code that was sent to me as an email, without realizing that I needed to come into the forum to find the code….I copied and pasted and the server error went away….the page reloads correctly.
Well, I added the code and still only one bio is showing up…I am going back to my code to see what I changed as now I only see one bio in the
What is the code that needs to be added after installing Co-Authors plus so that two author bios can appear??
Where did you put the code? As you’re effectively patching into Co-Authors Plus you’ll need to put this in your theme’s template files (or preferably create a child theme from your theme) for each sort of template that you want the Biography Box to show up in.
This code doesn’t live in
functions.php
; it won’t do anything there.If you use
raw
mode, then you’ll get the Biography Box regardless of the plugin’s settings in the Dashboard, but if you use configured mode, then the Biography Box should obey the plugin’s settings.For example, to display a Biography Box for each author using TwentyTen’s single template (
loop-single.php
) you’d do something along the lines of the following:<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div id="nav-above" class="navigation"> <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?> </div> <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> </div><!-- #nav-above --> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="entry-meta"> <?php twentyten_posted_on(); ?> </div><!-- .entry-meta --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?> </div><!-- .entry-content --> if (function_exists('get_coauthors')) { $coauthors = get_coauthors (); if ($coauthors && !empty($coauthors)) { foreach ($coauthors as $author_id) { $mode = 'raw'; wpb_the_biography_box ($mode, $author_id); } // end-foreach } } // end-get_coauthors-check <div class="entry-utility"> <?php twentyten_posted_in(); ?> <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?> </div><!-- .entry-utility --> </div><!-- #post-## --> <div id="nav-below" class="navigation"> <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div> <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div> </div><!-- #nav-below --> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?>
… you’ll still need to tweak this code to use the Co Authors Plus template tags (https://vip.wordpress.com/documentation/incorporate-co-authors-plus-template-tags-into-your-theme/) in place of the standard WordPress tags for author information, such as using
coauthors_posts_links
instead ofthe_author_posts_links
.How you do this and which template files you’ll need to edit will depend on how your theme is structured.
-Gary
- The topic ‘[Plugin: WP Biographia] Multiple Author Boxes are showing up’ is closed to new replies.