Two methods:
Edit the template file:
Find the template file that renders your posts (most likely index.php
) and find the place where the post loop starts.
Something like:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Any content added before this code will be shown before your blog posts.
Insert via hook:
add_action( 'loop_start', 'wpse107113_loop_start' );
function wpse107113_loop_start( $query ){
if( $query->is_main_query() ){
echo "<p>Hello World!</p>";
}
}
Related Posts:
- Custom text box containing post titles
- Display recent posts with thumbnail within Masonry
- How do I use wp_get_recent_posts?
- Add Date to Recent Posts Widget?
- Recent Posts widget has some older posts at the top? [closed]
- how to show post content with post name in sidebar?
- Adding a badge to new blog post titles
- How to make slider show 4 recent news and news start from begining not from 4th
- Display recent post by tag
- WordPress Recent post only showing title
- Recent post on single page from specyfic category
- How to display posts on template
- Help with “Recent Posts” Loop that is specific to a topic
- Get Each user recent post in wordpress
- Code for Recent Posts Widget
- Modify recent post sidebar to show post thumbs with out plugins
- Display all comments or recent comments per user on author page
- Add inline HTML to posts published within last 24hrs
- Add thumbnail to recent posts widget using filters
- How to exclude categories from recent posts, recent comments & category widgets?
- meta_query not working properly
- Unable to show recent custom post types in default recent posts widget
- Empty excerpt using wp_get_recent_posts
- Show recent published posts
- If numberposts = -1 offset won’t work
- How to display recent posts added in several custom post types
- Order posts by meta value and Date
- What’s the difference between “get_posts” and “wp_get_recent_posts” when used with “setup_postdata”?
- How can I show recent posts from same taxonomy as the post currently being viewed?
- How to display recent / random posts by its category
- Grabbing specific content
- How to get most recent commented post above new submitted post in WordPress?
- Two posts are loaded instead of one?
- Recent Posts widget without Title
- Change recent posts widget title
- Create static front-page with 3-5 recent posts
- Display most recent post on homepage?
- How to truncate titles in Recent Posts widget?
- Customizing wordpress default widgets?
- Recent posts with featured image or fallback image with permalink
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- How do I add recent posts to the menu?
- WP Bakery Load More Button loads the same posts
- How do I exclude recent post from recent post php widget
- menu item to display the most recent post
- WP_Query with offset and ‘orderby’ => ‘rand’, offset not working
- Custom recent-posts shortcode’s thumbnail image not in line with rest of code
- Proper way to display latest 5 posts grouped by post type?
- Reset WordPress Post Query to default
- Author list based on recently active
- How to get excerpt of the recent posts
- List most recently added posts (with a twist)
- Recent posts on homepage
- How to obtain the recent posts without their content in an efficient way?
- How to check if the current page is at a specified path in the URL?
- Posts modified in the last 48 hours
- How to avoid duplicates when creating recent network posts
- How to Link to Most Recent Custom Post of Same Term
- Display css ONLY on most recent post of specific category?
- Sort / display recent posts by publish date
- Add hero image to home page (blog format) via the dashboard
- Exclude latest post from WP_Query taxonomy term loop
- Why aren’t paragraphs breaking on this page?
- Problem with Front-Page.php loading recent posts
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Where to add offset?
- Homepage custom recent news
- post preview/thumbnails not displaying correctly- linking to “home” instead of post?
- How do I add a small excerpt of a blog post on my Front Page Recent Posts widget?
- Import Recent Posts Only and Ignore old ones if exist
- add title to widgets of wordpress
- Cannot manage to display my CPT in Recent Posts widget
- Display Most Recent Post Widget Title On Page
- The styles in the recent posts widgets plugin not working
- Linking to the most recent post in my podcast category
- WordPress recent post
- Posts Per Page with a button to add more Posts
- Is it possible to show thumbnails along with recent post from a wordpress blog on static website’s homepage?
- How to filter wp_get_recent_posts() to only posts that have thumbnails?
- Showing wordpress latest post thumbnails in slider with auto increment
- Best way to add image to recent posts widget?
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Recent Posts Widget URL / Domain change
- Recent post in the middle of the content
- Recent posts show thumbnail
- Paginate recent posts widget
- Show all posts of all categories but excluding a category on custom blog page with pagination of my theme
- Show recent posts in single-post page
- Duplicate content with the same URL, google authorship
- shortcode for recent custom type post
- Building Menus with the latest posts included
- Query recent posts by author
- Adjust layout most recent post, taking pagination into account
- Author Link in Recent Posts Widget
- how to show the most viewed, random and recent posts in the home?
- Lists Top Authors by Most Recent Posts
- How to display recent posts on home page with title, post date, author and featured image?
- Recent posts with different class name for each post and a scrollbar?
- Recent posts with comment count in “Sidebar” template [closed]
- How to display Most Recently Read 10 Posts by a logged in user in wordpress