Deregistering Custom Post Types

Deregistering Custom Post Types from WordPress is easy and simple.

Follow the steps below:

<?php
/**
 * Deregister matching post types.
 */
function unregister_custom_post_types() {
    global $wp_post_types;
    foreach( array( 'services', 'staffs', 'projects', 'testimonials' ) as $post_type ) {
        if ( isset( $wp_post_types[ $post_type ] ) ) {
            unset( $wp_post_types[ $post_type ] );
        }
    }
}
add_action( 'init', 'unregister_custom_post_types', 20 );

Make Divi Accordions Closed by default

To do so, add the following JavaScript codes via Divi > Theme Options > Integrations > Head Code

<script>
jQuery(function($){
    $('.et_pb_accordion .et_pb_toggle_open').addClass('et_pb_toggle_close').removeClass('et_pb_toggle_open');
    $('.et_pb_accordion .et_pb_toggle').click(function() {
      $this = $(this);
      setTimeout(function(){
         $this.closest('.et_pb_accordion').removeClass('et_pb_accordion_toggling');
      },700);
    });
});
</script>