I'd Like to know what is the proper way on removing this little piece of code on a child wordpres theme

<?php if( houzez_option('spl_con_tennant') != "" ) { ?>
                        <option value="tennant"><?php echo houzez_option('spl_con_tennant', "I'm a tennant"); ?></option>
                        <?php } ?>

How can I remove that conditional on a child theme?

the conditional is not the functions.php file

  • 4
    Is it in a template file? If so, copy the template file to your child theme, and edit the copy in the child theme to remove the offending code. – Pat J Feb 22 at 20:51
  • Yes, it is a template file, thank you for that! but it is actually the best way to do it? – Carlos Bermudez Diaz Feb 23 at 13:47
  • A child theme's template file will override the parent theme's file with the same filename. So yes, this is a valid way to remove the unwanted code. The only better way that I can think of will depend on if the parent theme uses a filter or an action to apply the code. If it does, you can use remove_filter() or remove_action() to get rid of it. – Pat J Feb 23 at 16:52
  • Ok Thank you Pat! – Carlos Bermudez Diaz Feb 24 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.