Here are some ideas:
a) Instead of
is_category(4,5,6)
which checks if a category archive page is being displayed (see here), you can try
in_category(4,5,6)
or
in_category( array(4,5,6) )
that checks if the current post is assigned to any of the specified categories (see here).
b) You could also try
function woo_post_meta() {
if ( in_category(4,5,6) ) {
return "";
}else{
// the original woo_post_meta() code here.
}
}
c) If the original woo_post_meta()
contains an output filter, than we could add a custom filter with the above category check.
d) If you write your own child theme, you could replace the template tag:
woo_post_meta();
with
if ( !in_category(4,5,6) ) {
woo_post_meta();
}
Related Posts:
- Override get_template_directory() in child theme?
- why is translation not working on theme?
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- is there a simple way to list every templates / php files used to generate a specific page?
- Conditional Statement – check if post has an attachment image
- Setting up the child theme so as to enable right-to-left WordPress?
- How to override a non pluggable and non hookable function in a WordPress parent theme?
- Trying to use Ternary operators with WP Conditionals
- How to stop PHP code running when in a child theme
- Overriding a theme redux file in child theme
- How to do conditional publishing?
- child theme inherticance and php autoload
- How do I target the child theme with get_bloginfo();?
- conditional statement for custom taxonomy
- Deregister and Dequeue Stylesheets From a Plugin and Enqueue a Child’s Stylesheet/s
- Adding tawk.to code just before body tag on functions.php file
- Add user settings to specific roles
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Create a new usermeta field for users
- Can’t extend some core classes
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- Redirect to a different page through registration, depending on page
- Parent theme CSS overriding child CSS rules
- How to style options page in dashboard?
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- What is the correct way to write this conditional statement?
- Reordering Buddy Press profile navigation [closed]
- Replace part of a parent-theme customizer in the child-theme
- two columns of posts on homepage, one of them “favorites”
- Custom Background by Page IDs
- Copyright info change – Corporate Plus Theme PHP [closed]
- Advanced Custom Fields – display label and value only if value entered
- How to check if the current page is at a specified path in the URL?
- Started getting warning message following host’s PHP upgrade
- Add class to DIV depending on page loaded
- Why does the Woocommerce grouped template prints the unpublished products?
- Divi change project category slug
- Warning: printf(): Too few arguments in helpers.php file
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- WordPress filter load_textdomain_mofile not working inside a child theme’s functions.php but works form inside a plugin
- How do I check or test a WordPress Auto Year Change Script?
- Use custom template on custom post type
- Can I set up a hover animation in CSS depending on a PHP conditional?
- How to have different site identity logos on each page on Astra Theme [closed]
- Include style.css in the Child Theme with PHP
- Problems clearing cache
- Multidimensional Array
- Removing “Powered by” footer using child theme PHP [closed]
- Overide Variable in Child Theme
- child parent styles enqueue order
- Creating a child theme after numerous edits to parent theme
- using wp enqueue style to create a CSS file specifically for a page template
- How to make a conditional statement within $output in shortcodes.php?
- How to style injected code in header section?
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Child Theme’s Read More Text
- Need advice on theme customizer and child themes
- exclude custom post type from running a function
- include content within conditional statement?
- Trying to change featured image from 180×180 to full width on home page
- Show label for value only when value exists, basic php
- How to edit background color of only one sidebar?
- Why would the child theme load in the Customize preview, but not on the site itself?
- Proper way to remove html code on child theme
- remove_action from parent theme using child theme functions.php
- File from parent theme imported to child theme doesn’t work – any ideas?
- Conditional formatting on data fetched from MYSQL
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- Find and print first entry from WordPress post in custom excerpt?
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Adding if statement
- How to change the structure/order of sections in a WordPress theme? [closed]
- How to edit button permalink inside function.php using a child theme?
- How to locate parent theme functions and add functions to my wordpress child theme?
- How to let mobile navigation menu close when link is clicked?
- Modifying child theme’s header
- How to Change Site Elements based on referring URL
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- If i use a child theme to add new code blocks to header.php, how does it get inserted in the right place in parent’s header.php?
- WordPress child theme, creating a custom php template page
- How to override html codes in wordpress?
- random woocommerce categories are not showing when count enabled?
- Add Text Area To Child Theme’s Home Page
- Local WordPress from Git repo, where to set document root?
- Where to find the html for WordPress site? [closed]
- Child theme functions.php file change database entries
- How to remove image on single product and get product to span page?
- Jetpack: Display Site Title when no Site Logo
- If else statement based on referral URL
- Removing get_template_part in child theme
- Php conditional help needed
- Custom Meta Box If Else Statement
- If I define a variable in header.php, how do I make it available to templates?
- How do I reformat this to add php inside php?
- Not able to see the error [closed]
- Divi – add title to mobile menu button
- How can I use AJAX in child theme template?