Ready to get started?Download WordPress


Display Posts Shortcode
[resolved] Making the title BOLD and adding ...read more/ ...more to the end (8 posts)

  1. mrblindpig
    Posted 2 years ago #


    Thanks for this great plugin, been looking all over, and this is perfect.

    I managed to get it configured with my theme, and put them into columns, so all good there.

    But, I wanted 2 things only to happen, one for the title of the post to be displayed in bold? As it just reads as part of the text at the moment, and the other, was that there is no link at the end of the excerpt? Like a ...more or ...read more link to the post. I know the image and the title are, but its quite confusing to visitors?

    Is there an easy shortcode I'm missing?

    Thanks in advance


  2. cwc123
    Posted 2 years ago #

    I second this request!

  3. liarphoto
    Posted 2 years ago #

    RE: / read more link

    Go into your display-posts-shortcode/display-posts-shortcode.php in the plugin editor and make these changes:

    if ($include_excerpt) $excerpt = ' <span class="excerpt">' . get_the_excerpt() . '</span>';
    else $excerpt = '';

    $more = '

    /

    $output = '<' . $inner_wrapper . ' class="post">' . $title . $image . $date . $excerpt . $more .'</' . $inner_wrapper . '>';

    $inner .= apply_filters( 'display_posts_shortcode_output', $output, $atts, $title, $image, $date, $excerpt, $more, $inner_wrapper );

    I added 2 br/ to the area to match my themes CSS but you may want to change this.

    Hope it helps.

  4. liarphoto
    Posted 2 years ago #

    ack wordpress is converting my code to an actual read more link... here it is again

    $more = '

    <a.class="more-link" href="'. get_permalink() .'">/

    but I added a period between the "a and class" so wp won't convert it.

  5. liarphoto
    Posted 2 years ago #

    ok still converts it

    $more = '<br/*><br/*><a**class="more-link" href="'. get_permalink() .'">/ read more </a*>';

    remove the astricks and the ** should be one space.

  6. Bill Erickson
    Plugin Author

    Posted 2 years ago #

    As described in the plugin's documentation, the solution provided by liarphoto is NOT the proper way to modify the output. Use the output filter instead.

    In your theme's functions.php file or a core functionality plugin, place this: http://www.billerickson.net/code/add-read-more-to-display-posts-shortcode/

  7. mrblindpig
    Posted 2 years ago #

    Thanks both for the help.

    It doesn't solve my problem though.

    I can't find the documentation either, so am in the dark about what it has in there.

    When I did this, it added the read more into the page, but the title of the page still isn't bold, and it also wraps around the image instead of having its separate line?

    When I added the read more code it worked as I say, but then I added another shortcode to see if it would bold the title on a separate line and it ended up with an error on the functions page :/

    I've also noted that it adds a bullet point in front of each column in certain themes, don't suppose this can be stopped.

    I imagine that these are all noted in the documentation, but alas I haven't found that yet


  8. Bill Erickson
    Plugin Author

    Posted 2 years ago #

    The documentation is on the plugin's homepage ( http://wordpress.org/extend/plugins/display-posts-shortcode/ ). It's all the text describing how to use the plugin. Towards the bottom it describes how to customize the plugin using code.

    And here's a long list of examples: http://www.billerickson.net/code-tag/display-posts-shortcode/

    All the issues you describe are to be solved using CSS. The plugin simply outputs the content, it is your job to make it look the way you want.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic