Simply wrap the hooks in a conditional check something like:
if (is_home() || is_front_page()){
add_filter('posts_orderby', 'edit_posts_orderby');
add_filter('posts_join_paged','edit_posts_join_paged');
}
and leave the rest as is.
Related Posts:
- Display sorting options dropdown when using WooCommerce product category shortcode
- Drop down+sort blog posts date added/most popular
- What is the most efficient way to search users by their display name?
- Archive listing of posts by publish year (multiple years)
- Sortable admin column for one meta key with three possible meta values
- list posts and wrap them alphabetically A-Z
- Order posts randomly, not by date
- Nesting if statements to echo only one string based on what tag was filtered?
- Sort posts by custom fields value using dropdown menu
- Sort query_posts for Parent Pages to menue order or the count?
- How to sort posts based on the value (number) of a post’s metadata?
- Sort custom meta column by other meta value
- Sort the result of the main Query in shop page by a custom taxonomy
- How to implement a rating and review system for WordPress custom posts?
- Sort by page information by Ascending Numbers
- How to keep track of when a vote is cast?
- change the default order of posts only for specific categories
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- How to tag the main tag? [closed]
- Removing custom sort order from admin page listing
- WordPress sorting posts by date and title using a dropdown
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Array sorting assistance
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Query category-specific, paginated posts and allow viewer to change sort order
- Sort posts by title, sort array by largest number [duplicate]
- WordPress – show all posts + ones with specific tag
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Posts sortable column not sorting properly for custom field numbers
- category & sub category order issues in wordpress
- Sort author list alphabetically
- What is wrong with my sorting logic?
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- load/require specific php files for specific pages/templates/post types
- Activate different theme for temporary preview
- Execute a shortcode when clicking on a image
- Store loop into array
- Add a custom text field to WooCommerce admin product data “Variations”
- Show Specific Footer Widget for Specific Pages
- How do I output a database option that is an array into a get_posts array?
- Why is it necessary to prevent direct access to included files?
- Run a Parallel PHP Application with WordPress
- Display Post co-authored in Author Page
- How can I use a $wp_customize to edit my homepage image slider?
- Password protecting content in custom template
- Creating login session via CURL
- WordPress vs. Custom PHP [closed]
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How to Highlight unread WordPress posts?
- selected option if current category is the value
- Search Query: how to construct a search string from two select elements?
- Is it possible to retrieve all posts with a certain value for metadata?
- How to hook code to show after the_content?
- Run a code only on theme activation only during first activation
- Creating WordPress Shortcode with Variable
- Catchable fatal error: Object of class stdClass could not be converted to string
- variable value disappears in a second loop
- unknown issue in ‘header.php’ preventing theme from displaying fully
- Add meta tags to a custom header
- Ajax filter button display all posts
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- random display categories – change url
- Generate responsive post thumbnails of same size
- How to prevent a function from running based on host (ie web vs local)?
- Change out put of the_post_thumbnail in PHP
- Styling an “active” link outside of WordPress default menu
- WordPress permalink issue
- Any way to hide a blog posts text if it’s longer than let’s say 300 characters
- Delete images from media library when user deletes an image from ACF Gallery
- Array data not saving to specified sections. How to make seting independantly?
- How to get woocommerce orders with get_posts method in a shortcode
- Change category thumbnail size
- how to make wordpress user submit form once?
- Multiple Tag Filtering
- Need to show 7 posts from actual date
- How to reload a php script, using AJAX and jQuery
- Make wp_editor required
- I need to edit a widget, with no dashboard access
- problem in using wpdb->prepare and a string placeholder
- Custom content using in_category
- Get the total Author Favorited posts
- Need help with PHP functions
- WordPress WPDB::insert 13th param is always blank (only if format)
- When using shortcode, content stops generating after the_content
- MySQL query in WordPress with AJAX
- How do you detect if a specific word is at the end of a the_title()
- WordPress styling recent post
- Combining fancybox with multiple thumbnail plugin
- How to display thumbnail if post is assigned one otherwise not
- How to check “From Email” via WordPress before an email is sent
- Add specific phrase after every product title including the discounted price? [closed]
- Remove Unused Menu Locations
- How do I change the Go To Categories link in the term_updated_messages
- Hide category by tag
- understanding wp_next_scheduled
- How to add SKU and remove product title from WooCommerce url?
- php 8 compability admin interface
- How can I make below code to show grouping by country ranks in same div, example if in second loop rank 2nd must be show in same 2nd class div