Display Posts Shortcode
[resolved] Add author display to post // shortcode? (4 posts)

  1. amurphyatx
    Posted 3 years ago #

    Hi, love this plugin-- thank you, it's great work.

    I'd really love for my post authors to also be displayed below the snippet.

    Wondering if there was a shortcode I could add without diving into php. Something like include_author="true" or display_author="true" is what i'm after.

    Let me know if there's a way to do that. Thanks!

    -- alternatively, if it's php only, where would I go to edit your plugin string to make it show up?

    I appreciate it.


  2. Bill Erickson
    Plugin Author

    Posted 3 years ago #

    This currently isn't built into the plugin, but I've added it to the roadmap ( https://github.com/billerickson/display-posts-shortcode/issues/15 ).

    For now, it will require custom php coding. You'll need to use an output filter. Try adding this to your theme's functions.php file: http://www.billerickson.net/code/display-posts-shortcode-show-author/

  3. amurphyatx
    Posted 3 years ago #

    Bill, great news about the roadmap-- and thanks for your quick response.

    Still unable to get author to display, however. Dreamweaver showed me an error on the first snippet of author code which originally read:

    $author = '<span class="author">'by ' . get_the_author() . '</span>;

    I then changed it to the following, and the error went away:

    $author = '<span class="author">by ' . get_the_author() . '</span>';

    (in functions.php)

    I've also tried to take out the 'by' all together, thinking that was the problem, and have added .author {display:block;} in the css just for insurance. Still no luck.

    Any thoughts?

    Thank you for your time on this.

  4. amurphyatx
    Posted 3 years ago #

    Wait a minute-- i'm very sorry, but this just started working. Guess cache of functions.php takes a bit longer to reload.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Display Posts Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic