So far as I am aware, there is no hook in the location you need, if I understand you. The closest I can think of is loop_start
, which as you might expect runs when the loop begins. The problem with that hook is that you don’t know what content the theme may have between the <head>
of the document and the place where the Loop runs.
By far the best solution is to edit the functionality, or your own hook, into your theme if you’ve written the theme, or create a child theme and edit that if you are using someone else’s theme.
Related Posts:
- Modify upload directory to use post category slug in file path on multisite installation
- Get old values for post before saving new ones
- How to publish a post with empty title and empty content?
- How to add a “publish” link to the quick actions
- Action hook ‘wp’ firing twice… why?
- Count singular post views automatically
- Filter post before *editing*
- Custom function for “Submit for Review” hook
- How to filter content post only on save
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- the_posts filter been called multiple time
- How to generate numbers indistinguishable for the IDs of the posts
- How to retrieve the postID in a “image_send_to_editor” hook function?
- What is the filter or hook to add admin controls to posts on the front end?
- Adding buttons to Add New Post and Add New Page
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- How to access $post from a callback function
- Copy post to separate database with “add_action(….)”
- Trying to alter the post_content through the_post
- Call Web Services on post first publish
- What does WordPress do if I save a post without content/title? [duplicate]
- Adding bootstrap classes to video shortcodes
- Divs appearing everywhere in post content
- Modify posts listing at back end
- Prevent posts with certain post_meta to be edited
- Hook for changing excerpt content when excerpt not set
- Is it possible to add a shortcode below post title?
- Automatically set post_parent value
- Exists filter or action that change Add New Post link?
- Is there a way to know when a page has been updated and do some action only once?
- Restricting displayed posts to posts from only select authors
- the wp_post_update isn’t working all the time
- Is update_post_meta used when save_post action hook is invoked?
- Count singular post views automatically
- Grab meta data before post is saved
- Is it possible to completely replace a post with an action/filter?
- How to get the postID inside ‘content_save_pre’? Other hook?
- Is it possible to filter the main loop to exclude posts from a specific category?
- remove_action not removing add_action from constructor
- query post limits
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- Filtering posts on Post Administration Page by Week Number instead of by Month
- How to catch wordpress post ID when it’s published
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- How to check in functions.php if there is data in a WP_Query?
- Change the default blog post post attribute template name from “default template” to something else
- Post filtering is returning blank page
- Remove actions/filters that are set with create_function()
- Update post meta within save_post action
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- Updating permalink structure using ‘post_link’ filter results in 404 error for posts
- Remove tags without a specific meta key from “choose from the most used tags”
- How include css class based on post ( in loop ) slug?
- How to find list of all functions bind to a particular hook from my plugin?
- How to access page variable inside action hook
- Restrict displaying posts to the poster itself (in Back-end)
- Insert Content Before div#main from the functions.php File
- What is the action hook to use if you want to capture the new password during password change?
- Use has_filter on comment_post
- How can I edit comment meta value before it is saved?
- What hook can I use to modify custom post data before it is displayed on the page?
- Display taxonomy with a maximum number of letters
- How to hook into action/filter call
- Action hook to control access to certain parts of my site
- What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]
- changing parent_id on post
- wp_list_categories() Exclude All Categories Except One
- Get current taxonomy and display query accordingly
- Actions to use when flushing cache (when posts are added / deleted / modified)
- Trying to exclude custom posts based on date, while sorting by custom field
- Display custom product option in admin order details
- can’t modify post title using the_posts filter
- Replace Data In Post & Update Meta Field Post Is Saved
- Show only posts with titles/permalinks that do not contain certain words
- How do I display main query posts in random order using add_filter
- apply_filters() and call_user_func() to define and call a function outside a class
- Rewrite image links from attachment id to attachment link
- Filter wordpress posts without searching the keywords in the post content
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- Best way to fix bad count on All | Mine | Published
- Using AJAX to filter posts without refreshing page
- Posting to WP via URL
- style_loader_tag not changing stylesheet to preload
- Filter posts by month (dropdown)
- How can I change the date format of the revision list?
- Run a function when a custom post is update?
- Randomize post (and page) IDs on generation
- Hook to change the site URL
- Save_post – Warning: Cannot modify header information
- Hook when post is set from published to draft?
- Send email to user when I publish a new post
- Display/Filter post using if else statement
- How to add a custom class attribute into code wrapper? [duplicate]
- How Do I Unhook This Parent Theme Function?
- Hook to add content after date in post?
- Filtering private Posts
- how to filter posts by category without page load (ajax) in wordpress?