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?
- Issues with title-tag and document_title_parts
- Define page template in wp_insert_post
- Import WordPress XML File from Within Functions.php
- Add custom template page programmatically
- 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?
- Issue with get_theme_mod returning a blank value instead of the saved value
- Add action hook conditionally – only when home.php in use
- Filter the query ONLY for the search results page
- Show modified time if post is actually modified
- why doesnt is_home() work in functions.php
- How to create thumbnails for PDF uploads?
- Implementing DNS Prefetching with WordPress
- Help me to understand wp_header() and wp_footer() functions
- How can I tell if I’m on a login page? [duplicate]
- Warning/Notice about functions.php
- In WooCommerce I need to modify the thankyou.php page [closed]
- How can I add an extra WooCommerce hook
- Use ‘add_theme_support’ instead of ‘add_custom_image_header’ In WordPress 3.4
- Why get_header() or get_footer() does not run twice if called in the same php file?
- Remove Page Title from Static Frontpage
- How to override WordPress registration and insert an auto-generated username?
- Set default options for inserting media
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- How to hook into the quick edit action?
- gform_after_submission content appears immediately after , not in post body [closed]
- Custom page template how to check is_page from functions.php?
- How do I change parameters without changing the core
- Is it possible to be more page/post specific with admin_enqueue_script?
- Run Product Filter Javascript On Page Template
- 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
- Programmatically set page template based on page ID
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Adjust which tempalte a page uses with a function?
- How to specify which Gutenberg blocks are available in the editor for a page template
- Increment price for Woocommerce Minicart [closed]
- Gravity Forms field entries into wp_query loop [closed]
- Post thumbnail relative link and HTML modify
- Filtering posts by category name based on page’s slug
- Proper way of using functions in action hook?
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- How to properly add function called by action-hooked function to 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
- Add function to every post?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Activate small php condition at footer over page template
- Modify a function without editing template
- Don’t delete a page if it holds users
- Problem only while using require_once() within functions.php
- Get_template_part inside a folder
- Passing values from a widget to a function within a plugin
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- Execute a ultimate member action when user role is updated
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- 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”?
- Replace a menu with widget or a custom template file programmatically
- Footer disappears when using the_content ( )
- Get User Login Data (date, time… )
- Registration Hooks don’t appear to be working
- jQuery does not work
- Why does re-using this function not work? [closed]
- different style sheet for just one page template
- Override the WordPress core function wp_referer_field
- How to return hook data when multiple parameters are present?
- Hook into a function without a hook?
- Deprecated function get_user_by_email($email)
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- How to edit the Tags within the image file URLs?
- Is my code correct to enqueue CSS on a specific page?
- Can’t properly set the_title add_filter to show short_URL
- Control the srcset much more (not all sizes in it each time)
- How to add_filter html template to middle of content
- 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?
- Auto log in hook is requiring a page refresh
- Possible to hook into Media Library preview File column and use a custom image?