Okay
  Public Ticket #2000678
Portfolio body class with category slug
Closed

Comments

  • tonz003 started the conversation

    Dear Support!

    I would like to add category slug name to the portfolio body class.

    I would like to do this because I would like to have different design for different portfolio categories.

    How can I archive this, please help!

    Thank you in advance for your time and effort!


    Best regards,

    Tony



  •  675
    Neuron replied

    Hi Tony,

    Sure, you can achieve that via a small snippet in the functions.php(I would suggest the child theme functions.php).

    function custom_body_class($classes) {
        if (is_tax()) {
            $classes[] = 'my-custom-class';
        } return $classes;
    }
    add_filter('body_class', 'custom_body_class');

    The php works faster, it will immediately inherit your design.

    Feel free to ask for anything you need.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • tonz003 replied

    HI!

    Works like a charm! Perfect! Thank you very much!

    Have a nice day!

    Best regards,

    Tony

  •  675
    Neuron replied

    Good to know, feel free to ask for anything you need.

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.