- This topic has 7 replies, 2 voices, and was last updated 3 years, 5 months ago by Leo.
-
AuthorPosts
-
October 13, 2020 at 8:33 am #1486970Ryan Coisson
For some reason I notice that when I use Sections to create a post or a page that the Author Box doesn’t show at the bottom, however, if I just publish a piece of content with the native editor (not using Sections) it does show up.
Is there a way for it to show when using sections as well?
-R
October 13, 2020 at 10:56 am #1487206LeoStaffCustomer SupportHi there,
Are you using a plugin for the author box?
October 13, 2020 at 10:57 am #1487214Ryan CoissonHey Leo,
No, I have it coded into the site.
– R
October 13, 2020 at 11:04 am #1487228LeoStaffCustomer SupportWhat is the code you are using? Are you adding it using a hook?
October 13, 2020 at 11:12 am #1487242Ryan CoissonHey Leo,
Yes, I’m using a hook here’s the code:
<?php echo get_avatar( get_the_author_meta( ‘ID’ )); ?><h5 class=”author-title”><?php printf( esc_attr__( ‘About %s’, ‘the author’ ), get_the_author_meta( ‘display_name’) );?></h5>
<p class=”author-description”><?php echo wp_kses( get_the_author_meta( ‘description’ ), null ); ?></p>
——
And I have this code in the custom CSS:.author-box {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 4%;
margin-top: 30px;
font-size: 1em;
box-shadow: 0 9px 28px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}.author-links a {
font-size: 3em;
line-height: 0.5em;
float: right;
}.author-box .avatar {
width: 30px;
border-radius: 100%;
margin-right: 20px;
}.author-title {
font-weight: 700;
}h4.author-title {
margin-bottom: 0.5em;
}.author-description {
margin-bottom: 10px;
}/* For Mobile Devices */
@media (max-width: 768px) {
.author-box {
flex-direction: column;
text-align: center;
padding: 50px 10px;
}.author-box .avatar {
margin-right: 0;
margin-bottom: 10px;
width: 100%;
margin-top: -35px;
}.author-box .avatar img {
max-width: 70px;
}
}– R
October 13, 2020 at 11:18 am #1487251LeoStaffCustomer SupportUnfortunately Sections turn the default content container into a blank canvas (kind of like a page builder) so all the hooks within the content area are removed consequently.
I think the only solution is to turn that code into a shortcode and insert it manually.
October 13, 2020 at 11:23 am #1487261Ryan CoissonOk, how do I go about doing that?
Is there some documentation you can link me to?
October 13, 2020 at 11:34 am #1487283LeoStaffCustomer SupportSomething like this should help:
https://generatepress.com/forums/topic/creating-converting-shortcodes/#post-1423203 -
AuthorPosts
- You must be logged in to reply to this topic.