you make a mistake in the call of add_action
the last parameters must be changed from 1 to 2
add_action('pre_get_posts','shop_filter_cat',10,2);
Related Posts:
- Define custom Page Template without its own .php file
- how to change link of some wordpress pages
- How long does a deprecated function live in core?
- Import WordPress XML File from Within Functions.php
- Does hooking into the same action multiple times drain memory?
- How to influence the information displayed on widget inside wp-admin
- Extract image from content and set it as the featured image
- Is there a hook or function I can use to display all theme files being used on a current page?
- Filter the query ONLY for the search results page
- Show modified time if post is actually modified
- How to create thumbnails for PDF uploads?
- Implementing DNS Prefetching with WordPress
- Help me to understand wp_header() and wp_footer() functions
- Warning/Notice about functions.php
- How can I add an extra WooCommerce hook
- Use ‘add_theme_support’ instead of ‘add_custom_image_header’ In WordPress 3.4
- Remove Page Title from Static Frontpage
- How to override WordPress registration and insert an auto-generated username?
- Set default options for inserting media
- How to hook into the quick edit action?
- Custom page template how to check is_page from functions.php?
- Is it possible to be more page/post specific with admin_enqueue_script?
- WooCommerce add_action hook results in 500 error
- Issue adding text after short description on product pages Woocommerce [closed]
- Customize “the_posts_pagination” and put list instead div
- Adjust which tempalte a page uses with a function?
- How to specify which Gutenberg blocks are available in the editor for a page template
- Gravity Forms field entries into wp_query loop [closed]
- Post thumbnail relative link and HTML modify
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- Which action hook to use for function?
- Change size and crop medium_large images
- Gravity Forms – Using a Form to Pre-populate A Gravity Form [closed]
- is_account_page() change to page slug
- How to enable template page only for a post id page
- Running a script before absolutely everything
- Inserting a functions output after the content
- How to display post content instead of excerpt
- Modify a function without editing template
- Don’t delete a page if it holds users
- Problem only while using require_once() within functions.php
- Which action does wp_update_user triggers?
- How to use wp_trash_post (or wp_delete_post) for deleting a (or all) post(s) from custom post type?
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- Footer disappears when using the_content ( )
- Registration Hooks don’t appear to be working
- Why does re-using this function not work? [closed]
- Hook into a function without a hook?
- Is my code correct to enqueue CSS on a specific page?
- Can’t properly set the_title add_filter to show short_URL
- Filter yoast canonical add_action priority [closed]
- (Woocommerce) Order by price when entering specific category
- wp_create_category deprecated?
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- Is there a way to prevent a function/method from being called outside a specific hook?
- Function not working inside of a function in functions.php
- Adding code before post title with the_title produces weird results
- Add back in child theme what the parent theme removed with remove_action
- providing access to post_id or post inside functions.php
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Insert Content Before div#main from the functions.php File
- update_post_meta is Updating with two page id
- Page Template Won’t Load Correct CSS File
- How to conditionally add a widget via a hook in functions.php
- Changing the text of Upload/Insert on Posts and Pages Screen
- How to add or delete default value theme options while activate and deactivate theme
- WordPress comment processing . Default unapproved comments detection before posting
- Warning at top of website & top menu gone
- How to Override Page Template if URL matches query?
- Probleme shortcode with list author
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- How Can I Create a Friendly Slug for a Dynamic Page?
- custom error message for empty username and password using authenticate filter not working
- Get post_author email for Zapier Integration
- How can I stop the hook from breaking the login/logout function?
- Pagination won’t work on custom page
- True email confirmation for registration (keeping unvalidated users from user table)
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- Edit meta fields from within template
- How to echo the translated custom field?
- is_page_template wont allow me to enqueue scripts
- Function the_content
- save_post hook – headers already sent?
- Init hook for header send
- Add custom fields after post/page title
- Force resize for all video content
- Unhook the comment form in Buddypress
- How do I add functionality to images?
- How to hook wp_mail to add a custom email as BCC for each sent email?
- Logout redirect via page template without confirmation?
- Template Redirect Function Only Working When Logged In
- Get category of post inside save_post hook
- Create section wit form
- Log in and out using custom pages, no logout confirmation and redirects for logging in and out 2023
- Copy and Modified WooCommerce function is_coupon_valid [closed]