Free Range Edtech

Category: Tips ‘n Tricks ‘n Stuff

Putting WordPress Posts to Work with Display Posts Plugin

Posts. Posts. Posts. That’s what you write and publish in WordPress. They show up on your front page, newest first. Maybe you organize them into categories, which you can display… newest first.

But there’s a lot more you can do to use them in other ways with the Display Posts plugin, available to everyone’s sites hosted at the OpenETC. You can embed a listing of posts in page, a widget, even… inside another post! And you can use extra options to change which posts are selected, in what order they are listed (including my favorite, random) and how they are displayed (to show an excerpt, date published).

This is one plugin I use over and over.

I saw a possibility when Emily Schudel shared in our Mattermost Community (what, you are not in there? Join now) a fantastic project she has done for over a year for the Camosun College eLearning site. First, check out the Camosun Faculty Stories. They are a wonderful testimonial to the care and effort Camosun faculty put into adjusting their teaching to pandemic conditions.

Here you can find inspirational stories from faculty across Camosun College who bravely moved their courses from face to face to completely online, sometimes in a matter of a few weeks.

You will find a list of 22 Faculty stories Emily has collected and published as posts, and organized them as well into a Faculty Stories category. It is published as a WordPress Page, and I would guess that each time Emily publishes a new story, she has to update this page.

This is one place where Display Posts can make the list of stories dynamic, the page of Faculty Stories could be updated by itself when she published the next story in this category.

The first step is heading into your WordPress plugins, look for the one called Display Posts, and click the Activate link.

Nothing happens.

Yet.

This plugin is used in content via WordPress Shortcodes, they are things in brackets [.....] that are a placeholder for inserting content when published.

The basic use of the plugin is

[display-posts]

which would merely display a list of the 10 most recent posts. But it offers a wide range of extra options you can add to make it do something different.

To automate what is done in Emily’s manually edited lists of posts, I would use something like this shortcode – I know the options well but they are well documented:

[display-posts category="faculty-stories" order="ASC" posts_per_page="-1"]

This says to select posts only from the Faculty Stories category (using the part of URL used in displaying the category) https://camosunelearning.opened.ca/category/faculty-stories/ The ASC option for order flips the default action to list newest posts first, we want to list them in the order they were published. The posts_per_page value of –1 is a trick to have to display all posts (otherwise you only get only 10 posts).

If Emily wanted to include an excerpt from the post and a link to continue reading, this should work:

[display-posts category="faculty-stories" order="ASC" posts_per_page="-1" include_excerpt="true" excerpt_more="Read more..." excerpt_more_link="true"]

There are other ways Emily could put her posts to work. She could create a sidebar or footer text widget (or use in any page/post) with a Display Posts shortcode that displays 5 random stories.

[display-posts category="faculty-stories" orderby="rand" posts_per_page="5"]

Each time the page is viewed, it should list five random stories from the collection.

I find this plugin useful too on sites where I change the option on my site to use a WordPress for the home rather than just the newest posts — see Take Control of the Front of Your WordPress Site. I used this for the Stories of OpenETC in Action site to have a welcome message on the landing page. In the middle of this page, I use the Display Posts plugin to list 5 random stories:

[display-posts posts_per_page="5" orderby="rand"]

that generates a different set of 5 on every view:

Screenshot that shows a list of 5 different linked stories, on the right is the text of the shortcode listed above
See the randomness at https://openetc.opened.ca/

You can just have posts come up as WordPress gives them to you, or you can take over control and display them in many more different ways with the Display Posts plugin.

And if that’s not enough, wait until you see what is possible for Pages with the Page-List plugin.


Image Credit: Image by Daniel Hannah from Pixabay 

Take Control of the Front of Your WordPress Site

The default display of most WordPress themes is the standard reverse chronological listing of published posts (newest stuff first). This works fine as a blog or reflective journal.

But with one small trick, you can take over the front page of any site with the information you want to provide there- an introduction or overview, and invitation to take part, maybe a current assignment. And you can provide that chronological listing to a secondary page.

I have mocked up a demo for this concept for the home of fictitious academic, Dr Blog. It is pure gibberish with filler text from a cosmic generator, random images from pravatar.cc, but also making use of some layouts only possible in the WordPress block editor, which is an open choice for you. But note the front entrance is not a stream of posts.

Okay, I could not resist slipping in a few more tricks like random header images, category descriptions, a wee bit of custom CSS to make the subtitle more readable. These are teasers, but if you want to learn more,just ask in a comment or the OpenETC Mattermost channel for WordPress fans.

Page It In

One of the longer points of clarification in WordPress is the difference between Posts, the things we do the most with, and Pages. They are very similar at the editing level.

Posts are organized by date and also category. But pages exist on their own, and are displayed only via links, adding to menus, etc. A typical use of a Page is the About page that usually comes by default in a new site (and many people ignore) which explains what the site is about. But they can also be used for offering a CV, contact information, a course description, an artist’s statement. A site might exist solely of Pages, maybe if it is more like a book, because Pages can be organized in an outline format.

But for now, the front page trick.

  1. Create a new Page with all the content you want to show up on the front. This can be almost anything. You can change it at any time. Or you could have a series of ones that maybe you swap in and out at different times of the year.
  2. If you want to have an interior page that has the default blog format, create a second Page with a title like “All Posts”, “Reflections”, or even “Blog”. It needs no content.

In your WordPress dashboard, look under Settings and select Reading. The top setting controls the front page layout with the default for Your homepage displays set to latest posts.

WordPress interface for Reading Settings with default setting of "Your homepage displays" set you "Your Latest Posts"

Switch that setting to A static page and use the menus to chose the ones you representing the front page (or Homepage), and optionally, one to show all your Posts (moving the blog post listing to an interior page). For Dr Blog, these settings look like:

The WordPress interface for Reading Settings with "Your homepagedisplays" set to "A static page". Below the menu for Home page has "Meet Dr Blog" selected and "Posts page" has "All Writings" selected

Save these settings, and zip over to your site. The front page of posts has been pushed aside! For Dr Blog, you can still access this via their interior page.

Big Deal or Not?

To me this is a key way to make a site more your own, as you can design anything you want in the front. But it makes sense for many sites to offer a welcome, or explanation, something other than post, post, post.

I would want this in a portfolio site to introduce visitors with information about me

I was nudged to write this from a question emailed from an OpenETC member who wanted to exclude a certain category of posts from their home page. To me, replacing with an information page, and then using categories, menus to direct visitors to specific groups of posts, is effective. In a future post I can share how a plugin like Display Posts (available here) can be used on a front Page to list posts from a certain category, rather than all posts.

I’ve used this for a previous course site that used the TRU Collector SPLOT theme for have students share responses, but I changed out the front page to reflect the current assignment. I also used this for a current course home page, using the stock Twenty-Twenty theme, but those pesky blocks to provide a custom layout.

I bet that others here are using this “trick”, I would love to see more examples to provide. And for future WordPress tips, let me know something you want use to cover.

This is one small way you can assert a bit more control over a WordPress site. I have many more in my bag, but I am sure others do too.


Featured Image: Take Control flickr photo by Rasta Taxi shared under a Creative Commons (BY-NC) license modified by Alan Levine to be better cropped for a blog header.

Blocks or Not? You Decide

Few things divide WordPress folks as much the [relatively] new Block Editor, aka “Gutenberg” vs the venerable Classic one.

You are either one side or the other.

A frame by frame Photoshop edit by Alan Levine of the numerous Rabbit Season / Duck Season GIFs found on giphy and very much in murky copyright waters. It’s parody!

The 2500+ WordPress sites here at the OpenETC all run from a shared install of the software, so we constantly try to balance everyone’s desires. We allow all users to choose Rabbit or Duck via the Classic Editor.

Recently we changed things for new sites to be set by default for the Block Editor- this may have triggered notices for all WordPress users, but no one is taking away your Classic Editor. You still get to choose. You can check and manage your WordPress Editing environment under SettingsWriting in the Dashboard / admin area of your site. These are your options and you can change them anytime.

I’m Fully Into the Block Editor (Daffy Duck)

Copy these options under SettingsWriting

Even if the user is just you, set Default editor for all users to Block editor and set Allow users to switch editors to No. You will not lose any content, and your previous posts will all show up in the “Classic Block” which is close to the old one. All new posts will be done in the Block Editor.

I have gotten rather accustomed to the Block Editor. It means each paragraph is its own thing. Yes, I still stumble over things, but as the features have expanded in the last year, I am liking the structural things I can do in pages that previously called for plugins and theme specific interfaces. I have accepted the Block Way (but am free to cuss at it any time).

I’m Not Giving Up My Classic Editor (Bugs Bunny)

Copy these options under SettingsWriting

Even if the user is just you, set Default editor for all users to Classic editor and set Allow users to switch editors to No. You will keep on using the editor you love and cherish. We will try to make this available to you as long as we can.

But the future direction of WordPress is aimed at the Block Editor, and officially support for the Classic Editor plugin stops December 31, 2021. That does not mean Classic goes away, but it might have implications in the future as the WordPress Core evolves.

I am on the Fence and Prefer to bounce Back and Forth (Bugs Duck? Daffy Bunny?)

Copy these options under SettingsWriting

Set Default editor for all users to whichever one you prefer set Allow users to switch editors to Yes. This means that any author on your site can use whichever editor they want on a post by post basis. With this setting, when you look at the lists of posts in your site, it indicates which one it will use by default. If you hover your cursor over any title, the quick links provide the tools you can use to edit in either one! You choose.

To me, this makes it a bit more complex, but might be preferable as you are learning to adjust to the new editor, but or important work, yo might want to use Classic if it is more productive for you.

To someone reading your site, it makes no difference which editor you use; both editors generate good old HTML. It’s more of an issue on finding a way to continue writing and publishing while learning to ride a new editor.

If you have any questions concerns, leave a comment below. But better join us in the OpenETC Mattermost where we have a WordPress channel for getting answers, or just publicly displaying your love or loathing of the Block Editor. For an illustrated guide to editors, switching, and more resources, see Troy Welch’s post explaining this to users of the Thompson Rivers University TRUbox WordPress site (which works just like this one, and is also under Troy’s nurturing system administration care, please remember to thank Troy!)

Do you want more information, tips about using the Block Editor? We do have a few plugins available that extend its capabilities even more.


Featured Image: Pixabay photo by Matthias Böckel edited by Alan Levine to include WordPress and OpenETC logos.

Powered by WordPress & Theme by Anders Norén