define('HOWTOHUB_VERSION','3.0.0'); function howtohub_setup(){ register_nav_menus(array('primary'=>__('Primary','howtohub'),'footer'=>__('Footer','howtohub'))); add_theme_support('post-thumbnails'); add_theme_support('title-tag'); add_theme_support('html5',array('search-form','comment-form','comment-list','gallery','caption')); set_post_thumbnail_size(800,450,true); } add_action('after_setup_theme','howtohub_setup'); // Enqueue - single CSS file, single JS file function howtohub_scripts(){ wp_enqueue_style('howtohub',get_template_directory_uri().'/assets/css/main.css',array(),HOWTOHUB_VERSION); wp_enqueue_script('howtohub',get_template_directory_uri().'/assets/js/app.js',array(),HOWTOHUB_VERSION,true); } add_action('wp_enqueue_scripts','howtohub_scripts'); // Nuke all block styles add_action('wp_enqueue_scripts',function(){ foreach(['wp-block-library','wp-block-library-theme','global-styles','classic-theme-styles','wp-img-auto-sizes-contain-inline-css'] as $s) wp_dequeue_style($s); remove_action('wp_head','print_emoji_detection_script',7); remove_action('wp_print_styles','print_emoji_styles'); },100); // Clean head remove_action('wp_head','wp_generator'); remove_action('wp_head','wlwmanifest_link'); remove_action('wp_head','rsd_link'); remove_action('wp_head','wp_shortlink_wp_head'); // JSON-LD Schema function howtohub_json_ld(){ if(!is_single())return; $schema=array('@context'=>'https://schema.org','@type'=>'Article', 'headline'=>get_the_title(),'datePublished'=>get_the_date('c'),'dateModified'=>get_the_modified_date('c'), 'author'=>array('@type'=>'Person','name'=>get_the_author()), 'publisher'=>array('@type'=>'Organization','name'=>'HowToHub','logo'=>array('@type'=>'ImageObject','url'=>get_template_directory_uri().'/screenshot.png'))); echo ''; } add_action('wp_head','howtohub_json_ld'); // OG function howtohub_og(){if(is_single()){echo '';if(has_post_thumbnail())echo '';}} add_action('wp_head','howtohub_og'); // Category helpers function howtohub_cat_icon($tid){$i=get_term_meta($tid,'howtohub_icon',true);return $i?:'📁';} function howtohub_cat_color($tid){$c=get_term_meta($tid,'howtohub_color',true);return $c?:'#6366f1';} // Default cat meta on activation function howtohub_default_cats(){ $d=array('āϞāĻŋāύāĻžāĻ•ā§āϏ'=>array('🐧','#f59e0b'),'āϏāĻžāĻ°ā§āĻ­āĻžāϰ'=>array('đŸ–Ĩī¸','#3b82f6'),'āĻ“āϝāĻŧ⧇āĻŦ āĻĄā§‡āϭ⧇āϞāĻĒāĻŽā§‡āĻ¨ā§āϟ'=>array('🌐','#10b981'),'āĻĒā§āϰ⧋āĻ—ā§āϰāĻžāĻŽāĻŋāĻ‚'=>array('đŸ’ģ','#8b5cf6'),'āĻĄā§‡āĻ­āĻ…āĻĒāϏ'=>array('âš™ī¸','#ef4444'),'āύ⧇āϟāĻ“āϝāĻŧāĻžāĻ°ā§āĻ•āĻŋāĻ‚'=>array('🔗','#06b6d4'),'āϏāĻŋāĻ•āĻŋāωāϰāĻŋāϟāĻŋ'=>array('🔒','#ec4899'),'āĻŽā§‹āĻŦāĻžāχāϞ'=>array('📱','#14b8a6'),'āϏāĻžāϧāĻžāϰāĻŖ'=>array('📝','#64748b')); foreach($d as $n=>$v){$t=get_term_by('name',$n,'category');if($t){update_term_meta($t->term_id,'howtohub_icon',$v[0]);update_term_meta($t->term_id,'howtohub_color',$v[1]);}} } add_action('after_switch_theme','howtohub_default_cats'); // Reading time function howtohub_reading_time(){ob_start();the_content();$c=str_word_count(strip_tags(ob_get_clean()));return max(1,ceil($c/200));} // Ad Spot Shortcodes function howtohub_ad_spot($atts){$a=shortcode_atts(array('size'=>'default'),$atts);ob_start(); echo ''; return ob_get_clean();} add_shortcode('ad','howtohub_ad_spot'); // AJAX Live Search add_action('wp_ajax_howtohub_search','howtohub_ajax_search'); add_action('wp_ajax_nopriv_howtohub_search','howtohub_ajax_search'); function howtohub_ajax_search(){ $q=sanitize_text_field($_GET['q']??''); if(strlen($q)<2){wp_send_json([]);} $r=new WP_Query(['s'=>$q,'posts_per_page'=>6,'post_status'=>'publish']); $res=[]; while($r->have_posts()):$r->the_post(); $res[]=['title'=>get_the_title(),'url'=>get_permalink(),'date'=>get_the_date(),'excerpt'=>wp_trim_words(get_the_excerpt()?:'',15),'cat'=>get_the_category()?esc_html(get_the_category()[0]->name):'']; endwhile;wp_reset_postdata(); wp_send_json($res); } // Bengali comment form labels add_filter('comment_form_defaults',function($d){ $d['title_reply']='āĻŽāϤāĻžāĻŽāϤ āϜāĻžāύāĻžāύ'; $d['title_reply_to']='āωāĻ¤ā§āϤāϰ āĻĻāĻŋāύ %s-āϕ⧇'; $d['cancel_reply_link']='āĻŦāĻžāϤāĻŋāϞ'; $d['label_submit']='āĻŽāϤāĻžāĻŽāϤ āĻĒāĻžāĻ āĻžāύ'; $d['comment_field']='

'; $d['comment_notes_before']='āφāĻĒāύāĻžāϰ āχāĻŽā§‡āχāϞ āĻĒā§āϰāĻ•āĻžāĻļ āĻ•āϰāĻž āĻšāĻŦ⧇ āύāĻžāĨ¤'; $d['must_log_in']='

āĻŽāϤāĻžāĻŽāϤ āĻĻāĻŋāϤ⧇ āϞāĻ—āχāύ āĻ•āϰ⧁āύāĨ¤

'; return $d; }); add_filter('comment_form_fields',function($f){ $comment=$f['comment'];unset($f['comment']); $f['author']='

'; $f['email']='

'; $f['comment']=$comment; return $f; }); https://howtohub.bd/ 2026-06-18T15:10:48+00:00 https://howtohub.bd/css-flexbox-guide/ 2026-06-18T15:10:43+00:00 https://howtohub.bd/wp-content/uploads/2026/06/css-flexbox-guide-hd.jpg https://howtohub.bd/linux-commands-cheatsheet/ 2026-06-18T15:10:44+00:00 https://howtohub.bd/wp-content/uploads/2026/06/linux-commands-cheatsheet-hd.jpg https://howtohub.bd/ssh-server-security/ 2026-06-18T15:10:44+00:00 https://howtohub.bd/wp-content/uploads/2026/06/ssh-server-security-hd.jpg https://howtohub.bd/devops-guide/ 2026-06-18T15:10:45+00:00 https://howtohub.bd/wp-content/uploads/2026/06/devops-guide-hd.jpg https://howtohub.bd/web-development-intro/ 2026-06-18T15:10:46+00:00 https://howtohub.bd/wp-content/uploads/2026/06/web-development-intro-hd.jpg https://howtohub.bd/programming-101/ 2026-06-18T15:10:46+00:00 https://howtohub.bd/wp-content/uploads/2026/06/programming-101-hd.jpg https://howtohub.bd/server-setup-guide/ 2026-06-18T15:10:47+00:00 https://howtohub.bd/wp-content/uploads/2026/06/server-setup-guide-hd.jpg https://howtohub.bd/linux-full-guide/ 2026-06-18T15:10:48+00:00 https://howtohub.bd/wp-content/uploads/2026/06/linux-full-guide-hd.jpg