[Resolved] Author Box on Posts Using Sections

Home Forums Support [Resolved] Author Box on Posts Using Sections

Home Forums Support Author Box on Posts Using Sections

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1486970
    Ryan 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

    #1487206
    Leo
    Staff
    Customer Support

    Hi there,

    Are you using a plugin for the author box?

    #1487214
    Ryan Coisson

    Hey Leo,

    No, I have it coded into the site.

    – R

    #1487228
    Leo
    Staff
    Customer Support

    What is the code you are using? Are you adding it using a hook?

    #1487242
    Ryan Coisson

    Hey 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

    #1487251
    Leo
    Staff
    Customer Support

    Unfortunately 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.

    #1487261
    Ryan Coisson

    Ok, how do I go about doing that?

    Is there some documentation you can link me to?

    #1487283
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.