How to Control Your WordPress Blog Post Display and Order
Content
Managing how and where your blog posts appear is a fundamental part of running a WordPress site. A common challenge users face is controlling post order, ensuring links work in excerpts, and displaying posts correctly on archive pages. This guide covers the most frequent issues and their solutions, based on community support threads.
Common Post Display and Ordering Issues
Users often encounter a few specific problems:
- New posts not appearing at the top of the blog list.
- Links within post excerpts not being clickable on the main blog page.
- Needing to sort posts by a specific criteria, like title, instead of the default date.
- Wanting to display a specific post (like an event list) always at the end of a list.
- All posts opening at the same URL instead of their individual permalinks.
Why These Problems Happen
These issues typically stem from WordPress's default behaviors, theme-specific configurations, or plugin conflicts:
- Default Chronological Order: WordPress is designed to show posts in reverse chronological order (newest first). If this isn't happening, it's often due to a theme or plugin overriding the main query.
- Excerpt Behavior: By default, the excerpt shown on archive pages is a plain text summary. It strips HTML tags, which is why links within the excerpt text do not work.
- Theme and Plugin Overrides: Commercial themes and page builders like Elementor add their own settings for querying and displaying posts, which can sometimes conflict with WordPress core or other plugins.
- Caching Issues: Aggressive caching plugins can sometimes cause problems, like serving the same URL for different posts.
How to Fix Post Ordering and Display
1. Ensuring New Posts Appear First
This is the default behavior. If it's not working, check your theme's settings for any options related to the blog page or post order. If you are using a page builder like Elementor to display posts, look within its 'Query' settings for the 'Order by' (set to 'Date') and 'Order' (set to 'DESC' for descending) options.
2. Making Links Clickable in Post Excerpts
To preserve HTML links in excerpts, you will need to use a custom function. This can be added to your child theme's functions.php file:
function wpse_allowedtags() {
// Add any HTML tags you want to keep in the excerpt
return array(
'a' => array( // allow anchor tags
'href' => array(), // allow href attribute
'title' => array() // allow title attribute
),
'br' => array(),
'em' => array(),
'strong' => array(),
);
}
function wpse_custom_wp_trim_excerpt( $text ) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content( '' );
$text = strip_shortcodes( $text );
$text = apply_filters( 'the_content', $text );
$text = str_replace( ']]>', ']]>', $text );
$excerpt_length = apply_filters( 'excerpt_length', 55 );
$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[...]' );
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
// Use the allowed tags function to keep HTML
return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );
}
remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
add_filter( 'get_the_excerpt', 'wpse_custom_wp_trim_excerpt' );
Warning: Editing theme files directly can break your site if done incorrectly. Always use a child theme and back up your site first, or consult a developer.
3. Sorting Posts by Title or Other Criteria
If you are using the block editor's Query Loop block or a page builder, this is usually straightforward. For a standard Query Loop block, edit the block and look for the 'Order by' setting in the sidebar, where you can choose 'Title' and 'ASC' (alphabetical) or 'DESC' (reverse alphabetical) order.
In page builders like Elementor, find the widget displaying your posts (e.g., 'Posts', 'Archive Posts'). Look for a 'Query' section in the widget's settings. There, you can often set 'Order by' to 'Title' and 'Order' to 'ASC' or 'DESC'.
4. Keeping a Specific Post at the End of a List
This requires a more advanced, custom solution. The general idea is to use a pre_get_posts hook in your functions.php file to manually adjust the query for a specific category or page. You would need to identify the post by its ID and force it to appear last through custom sorting logic. Due to its complexity, this task is best handled by an experienced developer.
5. Posts Opening at the Same URL (Permalink Issue)
This is often a sign of a severe caching issue or a problem with your post's permalinks. First, try these steps:
- Go to Settings > Permalinks in your WordPress dashboard and simply click 'Save Changes' without making any changes. This refreshes your rewrite rules.
- Clear all caching on your site, including any server-level cache (contact your host for this) and caching plugins like WP Rocket.
- Temporarily deactivate all plugins. If the problem is resolved, reactivate them one by one to find the culprit.
- If the issue persists with a commercial caching plugin, you will need to contact that plugin's support team, as support for commercial products is outside the scope of community forums.
When to Seek Further Help
If your issue is related to a commercial theme (e.g., Woodmart, Traveler) or a commercial plugin (e.g., WPML, WP Rocket, Elementor Pro), the best course of action is to contact the product's official support channel. Forum volunteers do not have access to these commercial products and cannot provide specific guidance for them. The developers of those products are the best resource for resolving conflicts and bugs within their code.
Related Support Threads Support
-
Same post going into multiple categories.https://wordpress.org/support/topic/same-post-going-into-multiple-categories/
-
Blog feed tag same as content, not the descriptionhttps://wordpress.org/support/topic/blog-feed-tag-same-as-content-not-the-description/
-
RSS subscription to my Gutenberg bloghttps://wordpress.org/support/topic/rss-subscription-to-my-gutenberg-blog/
-
Change bulk draft posts to publish in a different categoryhttps://wordpress.org/support/topic/change-bulk-draft-posts-to-publish-in-a-different-category/
-
Main Blog Page Article Linkshttps://wordpress.org/support/topic/main-blog-page-article-links/
-
How to post a blog post always at the end?https://wordpress.org/support/topic/how-to-post-a-blog-post-always-at-the-end/
-
Sort Posts by posts titles in Elementor Post Widgethttps://wordpress.org/support/topic/sort-posts-by-posts-titles-in-elementor-post-widget/
-
How to break a long essay into chaptershttps://wordpress.org/support/topic/how-to-break-a-long-essay-into-chapters/
-
Categories of postshttps://wordpress.org/support/topic/categories-of-posts-2/
-
New post not on top of blog?https://wordpress.org/support/topic/new-post-not-on-top-of-blog/
-
How to get a link to open in a new window?https://wordpress.org/support/topic/how-to-get-a-link-to-open-in-a-new-window/
-
Traveler theme problemhttps://wordpress.org/support/topic/traveler-theme-problem/
-
Just after the blog posts lists but on another page!https://wordpress.org/support/topic/just-after-the-blog-posts-lists-but-on-another-page/
-
All website blogs opens at one urlhttps://wordpress.org/support/topic/all-website-blogs-opens-at-one-url/
-
Post not edithttps://wordpress.org/support/topic/post-not-edit/
-
Wpml and elementor show posts for current lang?https://wordpress.org/support/topic/wpml-and-elementor-show-posts-for-current-lang/
-
Query loop paginationhttps://wordpress.org/support/topic/query-loop-pagination-2/
-
Grouping elements in WordPress editor makes them indentedhttps://wordpress.org/support/topic/grouping-elements-in-wordpress-editor-makes-them-indented/
-
Wonder blocks/Word press blog listinghttps://wordpress.org/support/topic/wonder-blocks-word-press-blog-listing/
-
Vertical title on new posthttps://wordpress.org/support/topic/vertical-title-on-new-post/
-
WordPress postshttps://wordpress.org/support/topic/wordpress-posts-3/
-
How can I specify more than 100 items in ‘latest posts’https://wordpress.org/support/topic/how-can-i-specify-more-than-100-items-in-latest-posts/