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?
- Can a page contain php code?
- Last class on last headline?
- Unable to Find Space in Custom Function
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- Strip Paragraph Tag
- Unable to process php via shortcode
- working with term_relationships table
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Creating a mobile site by adding a new class to the body tag from functions.php
- WordPress plug-in for dynamic download link?
- Using WP functions such as the_title() in an included php file
- GET problem in WordPress
- WordPress gallery shortag
- Almost Done… Post Format Code
- wordpress admin plugin menu custom css
- Help with page nav?
- Show recent posts starting at a specific number archive
- Add title=”” to A PHP Code
- Get Page ID from Backend
- Help with WordPress function inside a shortcode
- Wpdb->insert() doesn’t insert new row after the last one
- WordPress plugin admin page – using WordPress function in linked php file
- HTML table attributes ignored
- What’s the best way to include PHP code in pages?
- Is there any wordpress plugin to upload images and captions to multiple pages once
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- PHP in Edit Post link
- Removing the first 8-10 letters from a post?
- How to add drag and drop functionalities to a div inside option panel
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Timthumb.php image gallery not working on Multisite WordPress
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- How do you create two separate Register pages?
- $_GET[‘updated’] does not work in WordPress 3.1?
- Why doesn’t PhotoSmash plugin play well with wp_query?
- How to send form data from WordPress (Meta Box) to an OData service?
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Removing WordPress Footer -without access to PHP code?
- dynamic page using php from sql database
- Upload non-featured image to image field
- Usage of call back function of add_meta_box()
- Building a REST API for your web app exposes primary keys of DB records?
- WordPress get_media_embedded
- Change product_base programmatically
- wp_delete_comment takes two tries to delete – then deletes all comments
- php redirect with custom user roles set and working but redirect not working for when users are logged in
- how to get serialized post meta
- Hide Heading if ACF Field is empty
- Scheduling an event inside plugin class is not working
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- How to set a template with wp_insert_post
- WordPress Custom SQL Table with UserID Filter for results
- Automatically add images to a menu
- Display Yoast meta-description `wpseo_desc` within loop of categories and fail silently if no data is set [closed]
- Get access to variable from previous pageview, excluding ajax-calls
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- Permission callback to check if user has application password
- Load Posts on Click via Ajax into a DIV
- How to catch wordpress post ID when it’s published
- calling a custom field value inside functions.php
- What is the best way to define constant options for a theme?
- WordPress redirect redirecting too many times or not at all
- Can’t retrieve element with WordPress default @fetch_rss();
- set post limit at load more ajax wordpress
- I have a snippet to redirect all users to a maintenance page. How do I exclude users with admin role?
- php esc_html_e with an html link inside not working
- How to filter custom taxonomy term name, slug, and description?
- An audio player that showcase a random song from playlist every 24h [closed]