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?
- Childs PHP files not overwriting Parent’s PHP files
- why is translation not working on theme?
- Is it possible to disable a function of a parent theme?
- How to override an unpluggable parent theme function?
- 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?
- Copyright info change in Theme Child PHP
- Conditional Statement – check if post has an attachment image
- Add footer.php to WordPress child theme
- 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?
- Understanding WordPress child theme custom JS loading
- Trying to use Ternary operators with WP Conditionals
- Understanding child theme functions.php
- How to stop PHP code running when in a child theme
- Overriding a theme redux file in child theme
- How to do conditional publishing?
- Want to create Child theme, but already edited Parent theme css files and some php files
- 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”
- How to edit php files in Child Theme?
- WordPress Child Themes
- Is_front_page inside header.php is always returning true
- Custom Background by Page IDs
- Copyright info change – Corporate Plus Theme PHP [closed]
- Advanced Custom Fields – display label and value only if value entered
- PHP conditional script issue
- 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?
- How to edit HTML of my website on WordPress? [closed]
- Divi change project category slug
- How to specify the path for require_once in a child theme?
- 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
- Conditional featured image with youtube thumbnail
- 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?
- Inline CSS header style priority function.php Child (no enqueing I think)
- 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
- Child-Theme Category View with modified permalinks (%category% removed)
- If Month=Particular month display content [closed]
- Php conditional help needed
- Child theme not working properly
- Custom Meta Box If Else Statement
- Hide a nav menu item based on get_user_meta results
- 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?
- Child-theme suddenly stopped working [closed]
- Not able to see the error [closed]
- Divi – add title to mobile menu button
- How can I use AJAX in child theme template?
- Live Preview while customizing is not showing the updates while editing in WordPress
- How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
- Can’t make an external api call in php side of wordpress child theme
- Conditional concerning a selected tag not working
- Trying to insert widget code into theme function
- Unable to remove action from parent theme via child theme
- Disable astra_get_search_form from generating in header [closed]