Edin theme-increase recent posts or DATE parameters for display-posts shortcode

  • Author
    Posts
  • #2944650

    I’m on wordpress.com, using the Edin theme and I can edit my CSS.

    Right now, “https://pragmaticcompendium.com/recent-posts/” currently shows 5 posts with no navigation to go further back. (I haven’t blogged much in the last year, but I’m finally writing again)

    BEST case scenario is if I could get
    https://pragmaticcompendium.com/recent-posts/
    to display more posts per page (keeping the excerpts & thumbnails) and NEXT and PREVIOUS buttons appear at the end of the page to go backwards and forward chronologically.

    I’m wondering if I need to edit some CSS to change that or even if I need to edit the CSS, to make the [display-posts] shortcode parameters I’m trying to use instead, work.

    I found most of the shortcode parameters I’ve tried at this website: https://github.com/billerickson/display-posts-shortcode/blob/master/README.md#parameters

    I’ve successfully used the [display-posts] shortcode with categories, but I’d like to use it with dates. I’ve read that the display limit for [display-posts] is 100 posts, so I’m hoping to use the shortcode with dates in order to work around that limit. (I know I can use the [archives] shortcode, but I don’t see options to display a thumbnail and excerpt like I can with display-posts.)

    I tried the following code I found on github, but it doesn’t work:

    [display-posts date_query_before="2015-12-31" date_query_after="2015-01-01"]

    I even tried this:
    [display-posts date="2017"]
    [display-posts date="2016"]
    [display-posts date="2015"]

    Any ideas?

    The blog I need help with is pragmaticcompendium.com.

    #2944849

    Hi Julie,

    NEXT and PREVIOUS buttons appear at the end of the page to go backwards and forward chronologically.

    I’m afraid this isn’t built into the shortcode, so there isn’t a way to add this. CSS can’t be used to add links.

    BEST case scenario is if I could get
    https://pragmaticcompendium.com/recent-posts/
    to display more posts per page (keeping the excerpts & thumbnails)

    So this part can be done by using the posts_per_page feature of the display posts shortcode:

    https://en.support.wordpress.com/display-posts-shortcode/#arguments

    I found most of the shortcode parameters I’ve tried at this website…I tried the following code I found on github, but it doesn’t work:

    Hmm, so those actually relate to code that isn’t part of the WordPress.com platform. The guide on our shortcode is the one I linked above.

    I’m afraid there isn’t a way to get around the 100 post limit. Showing 100+ posts and images could make the page take a long time to load. It might also use unnecessary amounts of bandwidth for mobile visitors who don’t need to scroll very far down the page to get to what they need. In many cases, it may be better to use widgets or menu links to help guide visitors to what they want to need, as scrolling through 100 post titles to find something could be cumbersome.

    Out of curiosity, is there a reason you haven’t set your Recent Posts page to show your blog posts? If you wanted to do that, you could from My Site > Customize > Static Front Page. You would just choose Recent Posts from the “Posts page” section. It would let users navigate back in time that way, since the newest post would appear at the top of the page.

    Here’s what that looks like on the Edin demo:
    https://edindemo.wordpress.com/blog/

    You can even show featured images there, and limit the post to showing just the excerpt. You’ll find controls for turning on/off featured images and the post excerpt at My Site > Customize > Content Options.

    You can also change how many posts appear on your blog pages from My Site > Settings > General. There, you can adjust the Posts Per Page setting.

    Let me know if this helps.

    #2944853

    dcoleonline,

    Thanks so much for your thorough reply!

    With regard to your question about why I haven’t set my Recent Posts page to show my blog posts – I’ve used standard reverse chronological blog themes for over 10 years, but I switched to the Edin theme in order to create the category based front page structure I have now to help people discover to older blog posts that were buried by a reverse chronological display.

    I realize some people still prefer the familiar reverse chronological structure, so in order to simulate that, I created a link to a page called recent-posts and used the [display-posts] shortcode. I love the way it looks with the excerpt and thumbnail, and I definitely agree with you about not having the shortcode load 100 posts. That’s why I was hoping to create similar-looking page for each year using the code I found on github:

    [display-posts date_query_before="2015-12-31" date_query_after="2015-01-01"]

    I tried the date parameters from github because the author posted the following note to “WordPress.com Users”

    “This plugin is now available to all users of WordPress.com. There’s no installation necessary, just drop the shortcode in your page’s content area. Unfortunately you won’t be to use any of the filters listed in Further Customization since this requires customizing your theme, which isn’t allowed on WordPress.com”

    (from: https://github.com/billerickson/display-posts-shortcode/wiki#date-queries:)

    #2944864

    Hi Julie,

    That makes sense. I’m afraid not all of the functionality you see on GitHub is enabled on WordPress.com, but I’ve asked the developers to take a look to see if this can be added in the future. I can’t guarantee anything, but I’ve just put in the request, so it’s on their radar.

    For now, would linking to a year from an image or from your menu work?
    You could have a “Posts By Year” menu link and then have a dropdown with custom links pointing to each year like so:

    https://pragmaticcompendium.com/2016/

    From My Site > Customize > Content Options, you can also set your blog views to show only the excerpt instead of the full post.

    #2944865

    THANK you!

    I had tried https://pragmaticcompendium.com/2016/ before, but gave up because I didn’t know how to show only the excerpt!

    Which makes me wonder. In altering the CSS to hide the giant featured image from the top of the posts in the category view, have I kept the image from appearing as a thumbnail in this view? Because I’d LOVE to have the thumbnail display in the https://pragmaticcompendium.com/2016/ view.

    I used this code to hide the featured image on those pages:
    (you provided this code earlier a few days ago)

    /* Hide featured images on archives */
    .archive .post-thumbnail {
    display: none;
    }

    I’m wondering if I didn’t need to use CSS to hide the featured image from the posts, but instead have unchecked either/both:

    Display on single posts
    Display on pages

    in the Content Options.

    #2944866

    THANK you!

    You’re welcome! :)

    I used this code to hide the featured image on those pages:
    (you provided this code earlier a few days ago)

    You can change .archive to .category and that will let the featured images appear on the year view. They will remain hidden on the category view.

    So you would replace the old code with this:

    /* Hide featured images on Categories */
    
    .category .post-thumbnail {
        display: none;
    }

    I’m wondering if I didn’t need to use CSS to hide the featured image from the posts, but instead have unchecked either/both:
    Display on single posts
    Display on pages
    in the Content Options.

    You could definitely use Content Options, but they are more of a global setting for your site. So if you want featured images on some areas but not others, leave the Content Option set to show the images first. Then, if the CSS we have doesn’t hide the images in enough places, we can take a look to help you hide the images elsewhere.

    #2944867

    well…that worked…the featured image appears, so THANK You again!

    But…I definitely would not call those thumbnails. The images span the entire width of the excerpt, which for shorter, longer images, wouldn’t be too bad, but for images that are taller – they just take over the page.

    For instance, 2015 has some TALL images.

    Is there any way to reduce the display size of the featured image in the year view?

    Thank you so much for your patience!

    #2944889

    s there any way to reduce the display size of the featured image in the year view?

    Yep, this should do the trick:

    /* Set maximum height for archive featured images */
    
    .archive .post-thumbnail img {
        max-height: 300px;
        width: auto;
    }

    Adjust the 300 number to your liking.

    #2944891

    dcoleonline,
    Perfect. Once again, THANK you so much for all your help!
    Hope you have a GREAT week!

    #2944892

    Happy to help. Have a good one yourself!

The topic ‘Edin theme-increase recent posts or DATE parameters for display-posts shortcode’ is closed to new replies.