
/*
 * Custom PHP code for child theme will be here
 */

/** Adding child theme's style.css **/
function tm_boldman_child_style_css(){
	wp_enqueue_style( 'boldman-child-style', get_stylesheet_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'tm_boldman_child_style_css', 18 );

/** Deshabilitar comentarios completamente **/
function disable_comments_status() { return false; }
add_filter( 'comments_open', 'disable_comments_status', 20, 2 );
add_filter( 'pings_open', 'disable_comments_status', 20, 2 );

// Ocultar comentarios existentes del frontend
add_filter( 'comments_array', '__return_empty_array', 10, 2 );

// Eliminar comentarios del menú admin y del admin bar
function disable_comments_admin() {
	remove_menu_page( 'edit-comments.php' );
}
add_action( 'admin_menu', 'disable_comments_admin' );

function disable_comments_admin_bar() {
	if ( is_admin_bar_showing() ) {
		remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 );
	}
}
add_action( 'init', 'disable_comments_admin_bar' );

// Redirigir cualquier intento de acceso directo a la página de comentarios
function disable_comments_admin_redirect() {
	global $pagenow;
	if ( $pagenow === 'edit-comments.php' ) {
		wp_redirect( admin_url() );
		exit;
	}
}
add_action( 'admin_init', 'disable_comments_admin_redirect' );

// Eliminar el soporte de comentarios en todos los tipos de post
function disable_comments_post_types_support() {
	$post_types = get_post_types();
	foreach ( $post_types as $post_type ) {
		if ( post_type_supports( $post_type, 'comments' ) ) {
			remove_post_type_support( $post_type, 'comments' );
			remove_post_type_support( $post_type, 'trackbacks' );
		}
	}
}
add_action( 'admin_init', 'disable_comments_post_types_support' );<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://galileusconstruction.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-tm_portfolio-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-tm_service-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-tm_team_member-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-posts-tm_testimonial-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-taxonomies-post_tag-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-taxonomies-tm_portfolio_category-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-taxonomies-tm_service_category-1.xml</loc></sitemap><sitemap><loc>https://galileusconstruction.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
