Convert headings to sentence case

function convert_to_sentence_case($text) { $exceptions = array( ‘API’, ‘URL’, ‘HTML’, ‘CSS’, ‘PHP’, ‘SQL’, ‘XML’, ‘JSON’, ‘HTTP’, ‘HTTPS’, ‘CEO’, ‘CTO’, ‘CFO’, ‘USA’, ‘UK’, ‘EU’, ‘AI’, ‘ML’, ‘IoT’, ‘GPS’, ‘FAQ’, ‘PDF’, ‘SEO’, ‘ROI’, ‘KPI’, ‘B2B’, ‘B2C’, ‘SaaS’, ‘WordPress’, ‘WooCommerce’, ‘jQuery’, ‘JavaScript’, ‘MySQL’, ‘AWS’…Continue reading

PRINT WP POST

add_filter(‘the_content’, function($content) { if (!is_single()) return $content; $button = ‘ Print Post ‘; $pos = strpos($content, ‘ ‘); if ($pos !== false) { return substr_replace($content, $button, $pos + 4, 0); } return $button . $content; });Continue reading

Compatibilizar FiboSearch Pro com HPOS

// Compatibilizar FiboSearch Pro com HPOS (WooCommerce) add_action( ‘before_woocommerce_init’, function() { if ( class_exists( AutomatticWooCommerceUtilitiesFeaturesUtil::class ) ) { AutomatticWooCommerceUtilitiesFeaturesUtil::declare_compatibility( ‘custom_order_tables’, ‘ajax-search-for-woocommerce-premium/ajax-search-for-woocommerce.php’, true ); } });Continue reading

Redirect from Array

function custom_redirect_old_new_urls() { $redirect_urls = array( ‘/oldpage/’ => ‘/newpage/’, ‘/oldpage1/’ => ‘/newpage1/’, // Add more URLs here ); $request_uri = home_url( add_query_arg( array(), $_SERVER[‘REQUEST_URI’] ) ); foreach ( $redirect_urls as $old_url => $new_url ) { if ( untrailingslashit( $request_uri )…Continue reading

Property Analyzer Demo

// Add Property Analyzer Demo to WordPress function addPropertyAnalyzerDemo() { // Only add on homepage or specific pages if (!is_home() && !is_page(‘home’) && !is_front_page()) return; // CSS Styles echo ‘ ‘; // HTML Structure echo ‘ 🏠 See Our AI…Continue reading

Add the Page Slug to Body Class

function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading

Exclude Child Categories When Excluding Parent

function ruki_exclude_children_of_excluded_categories($query) { if ($query->is_home() && $query->is_main_query()) { $excluded = $query->get(‘category__not_in’); // Only proceed if exclusions exist if (!empty($excluded) && is_array($excluded)) { $all_excluded = $excluded; // Loop through each excluded parent to find children foreach ($excluded as $cat_id) { $child_ids…Continue reading

SEO Ready™ – ACF: Attorney Snippet (NLF)

$post_id = get_the_ID(); if (!$post_id) return; // Exit if no post ID // Basic attorney info $attorney_data = []; // Basic Information with null checks $attorney_data = [ ‘name’ => get_field(‘attorney_name’, $post_id) ?: ”, ‘honorificSuffix’ => get_field(‘honorificSuffix’, $post_id) ?: ”,…Continue reading