Page Element Shortcodes

add_shortcode(‘page_title’, function () { global $wp_query; if( isset( $wp_query ) && (bool) $wp_query->is_posts_page ) { return ‘Updates’; } return get_the_title(); }); add_shortcode(‘page_excerpt’, function () { return do_shortcode(get_the_excerpt()); }); add_shortcode(‘page_image’, function ($atts) { $args = shortcode_atts(array(‘size’ => ‘large’), $atts); return get_the_post_thumbnail(get_the_ID(),…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

indexing

function add_custom_meta_tags() { if (is_single()) { global $post; echo ‘‘.”\n”; echo ‘Continue reading

Open graph

// Add this to your theme’s functions.php file or a custom plugin // Disable AIOSEO Open Graph if you’re keeping another plugin/theme for it add_filter(‘aioseo_disable_opengraph’, ‘__return_true’); // If your theme generates Open Graph tags and you want to disable them…Continue reading

CLEAN & MINIFY ASSETS

HTML: CSS: Use CleanCSS or Webpack to minify. cleancss -o style.min.css style.css JS: Use Terser or Webpack. terser main.js -o main.min.js –compress –mangleContinue reading

kindle

Why the 2024 Kindle Paperwhite Is the Best E‑Reader Yet Looking for your next e‑reader? Amazon’s 2024 Kindle Paperwhite series raises the bar with speedier performance, a crisper screen, and features that delight both casual readers and A‑listers alike. Disclosure:…Continue reading

Product order WooCommerce

// Force alphabetical sorting on all product pages add_action(‘woocommerce_product_query’, function($q) { if (is_shop() || is_product_category() || is_product_tag()) { $q->set(‘orderby’, ‘title’); $q->set(‘order’, ‘ASC’); } });Continue reading

Ngăn WP cắt ảnh

add_filter(‘intermediate_image_sizes_advanced’, function ($sizes) { $sizes = array( ‘thumbnail’ => $sizes[‘thumbnail’], // Giữ lại thumbnail ‘medium’ => $sizes[‘medium’], // Giữ lại medium //’medium_large’ => $sizes[‘medium_large’], // Giữ lại medium_large ‘large’ => $sizes[‘large’], // Giữ lại large //’1536×1536′ => $sizes[‘1536×1536′], // Giữ…Continue reading