'Ana gezinme']);} add_action('after_setup_theme','baa_setup'); function baa_asset($path){return get_template_directory_uri().'/assets/'.ltrim($path,'/');} function baa_read_data($file){$path=get_template_directory().'/assets/'.$file;$data=is_file($path)?json_decode(file_get_contents($path),true):[];return is_array($data)?$data:[];} function baa_tools_url(){$p=get_page_by_path('arac-rehberi');return $p&&$p->post_status==='publish'?get_permalink($p):home_url('/');} function baa_all_posts(){static $posts=null;if($posts===null)$posts=get_posts(['post_type'=>'post','post_status'=>'publish','numberposts'=>100,'orderby'=>'date','order'=>'DESC']);return $posts;} function baa_post_data($post){$cats=[];foreach(get_the_category($post->ID) as $cat)$cats[]=['id'=>$cat->term_id,'slug'=>$cat->slug,'name'=>$cat->name];$text=wp_strip_all_tags(strip_shortcodes($post->post_content));$excerpt=wp_trim_words(wp_strip_all_tags(get_the_excerpt($post)),26);return ['id'=>(string)$post->ID,'title'=>html_entity_decode(get_the_title($post),ENT_QUOTES,'UTF-8'),'url'=>get_permalink($post),'excerpt'=>html_entity_decode($excerpt,ENT_QUOTES,'UTF-8'),'categories'=>$cats,'search_text'=>mb_substr($text,0,8000),'date'=>get_the_date('', $post),'image'=>baa_visual_image_data($post)];} /** Observe the selected template, not a broad conditional like is_archive(). */ function baa_listing_template($template) { $root = get_template_directory(); $listing_templates = ['front-page.php', 'home.php', 'page-blog.php', 'search.php', 'archive.php', 'index.php']; $GLOBALS['baa_listing_template'] = in_array($template, array_map(function($file) use ($root) { return $root.'/'.$file; }, $listing_templates), true); return $template; } add_filter('template_include', 'baa_listing_template', PHP_INT_MAX); function baa_is_listing() { return !empty($GLOBALS['baa_listing_template']); } /** Retain /blog/ as a 200 alias; do not change other routes or paged canonicals. */ function baa_is_blog_alias() { if (!is_page('blog') || is_preview() || is_feed() || is_paged() || (int)get_query_var('page') > 1) return false; $request_path = wp_parse_url(wp_unslash($_SERVER['REQUEST_URI'] ?? ''), PHP_URL_PATH); return $request_path === wp_parse_url(home_url('/blog/'), PHP_URL_PATH); } function baa_blog_canonical($url) { return is_string($url) && $url !== '' && baa_is_blog_alias() ? home_url('/') : $url; } function baa_blog_native_canonical($url, $post) { return $post && (int)$post->ID === (int)get_queried_object_id() ? baa_blog_canonical($url) : $url; } add_filter('wpseo_canonical', 'baa_blog_canonical', 20); add_filter('get_canonical_url', 'baa_blog_native_canonical', 20, 2); function baa_enqueue(){ foreach(['site.css','code-colors.css'] as $file)wp_enqueue_style('baa-'.sanitize_key($file),baa_asset($file),[],(string)filemtime(get_template_directory().'/assets/'.$file)); wp_enqueue_script('baa-site',baa_asset('site.js'),[],(string)filemtime(get_template_directory().'/assets/site.js'),true); $data=['home'=>home_url('/')]; if (baa_is_listing()) { $data['posts']=array_map('baa_post_data',baa_all_posts()); $data['search']=(string)get_search_query(); $data['category']=is_category()?(string)get_queried_object()->slug:'all'; } wp_add_inline_script('baa-site','window.BAAConfig='.wp_json_encode($data,JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_QUOT).';','before'); } add_action('wp_enqueue_scripts','baa_enqueue',99); function baa_bookmark_icon(){return '';} function baa_save($id){echo '';} function baa_meta($post){$names=[];foreach(get_the_category($post->ID) as $cat)$names[]=$cat->name;echo esc_html(implode(' · ',$names));$date=get_the_date('', $post);if($date)echo ' · '.esc_html($date).'';} function baa_card($post){$d=baa_post_data($post);?>

ID); ?>
ID,$sticky,true)){$featured=$candidate;break;}}?>
true]) as $cat):?>

Son yazılar

yazı

Bu tarayıcıda saklanır; diğer cihazlara eşitlenmez.

ID!==(int)$featured->ID)baa_card($post);}if(count($posts)<2):?>

Yeni yazılar eklendikçe burada yer alacak. Şimdilik araç rehberine ve kod örneklerine göz atabilirsin.

['class'=>true]]); ?>

Örneği indir · · Resmî dokümantasyon

<?php echo esc_attr($x['alt']); ?>
Kaynak
]*)>(.*?)~is',function($m){if(str_contains($m[1],'code-body'))return $m[0];$id=wp_unique_id('baa-post-code-');return '
Kod
'.preg_replace('~]*>~i','',$m[2]).'
';},$content);} add_filter('the_content','baa_wrap_code',20); require_once get_template_directory().'/inc/reading-features.php'; require_once get_template_directory().'/inc/visual-features.php'; // Article-only editorial reading layout; no changes to pages or feed queries. function baa_editorial_reading_assets(){ if(!is_singular('post'))return; $path=get_template_directory().'/assets/reading.css'; wp_enqueue_style('baa-editorial-reading',get_template_directory_uri().'/assets/reading.css',['baa-sitecss'],(string)filemtime($path)); } add_action('wp_enqueue_scripts','baa_editorial_reading_assets',101); function baa_growth_overview_links($content){if(!is_singular('post')||get_post_field('post_name',get_the_ID())!=='ev-labimda-devreye-aldigim-5-proje')return $content;$slugs=['wordpress-okuma-odakli-blog-temasi','synology-nas-tek-adres-https-split-dns','unifi-kablosuz-ag-salt-okunur-rf-izleme','unifi-iot-vlan-home-assistant-mqtt-guvenlik-duvari','homelab-haftalik-saglik-raporu'];$links='';foreach($slugs as$slug){$p=get_page_by_path($slug,OBJECT,'post');if($p&&$p->post_status==='publish')$links.='
  • '.esc_html(get_the_title($p)).'
  • ';}return $links?$content.'

    Ayrıntılı proje rehberleri

    Proje kütüphanesi ve sürümler

    ':$content;}add_filter('the_content','baa_growth_overview_links',25); function baa_growth_responsive_screens($content){ if(!is_singular('post')||!class_exists('WP_HTML_Tag_Processor'))return $content; $tags=new WP_HTML_Tag_Processor($content);$host=wp_parse_url(home_url(),PHP_URL_HOST); while($tags->next_tag('IMG')){ $src=$tags->get_attribute('src');if(!is_string($src)||wp_parse_url($src,PHP_URL_HOST)!==$host||strpos($src,'/wp-content/uploads/')===false||$tags->get_attribute('srcset'))continue; $id=attachment_url_to_postid($src);if(!$id)continue;$set=wp_get_attachment_image_srcset($id,'full');if(!$set)continue; $tags->set_attribute('srcset',$set);$tags->set_attribute('sizes','(max-width: 760px) calc(100vw - 32px), 740px');$tags->set_attribute('data-full-url',$src); $meta=wp_get_attachment_metadata($id);if(!empty($meta['width'])&&!empty($meta['height'])){$tags->set_attribute('width',(string)$meta['width']);$tags->set_attribute('height',(string)$meta['height']);} } return $tags->get_updated_html(); }add_filter('the_content','baa_growth_responsive_screens',30); function baa_growth_versioned_code_links($content){ if(!is_singular('post')||!class_exists('WP_HTML_Tag_Processor'))return $content; $old=['https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1/index.html','https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1-1-3/index.html','https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1-2-0/index.html','https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1-2-1/index.html','https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1-2-2/index.html'];$new='https://ilkerozbek.com/wp-content/uploads/baa-code/homelab-five-v1-2-3/index.html';$tags=new WP_HTML_Tag_Processor($content); while($tags->next_tag()){$tag=$tags->get_tag();$attr=$tag==='IFRAME'?'src':($tag==='A'?'href':null);if(!$attr)continue;$url=$tags->get_attribute($attr);if(!is_string($url))continue;foreach($old as$prefix){if($url===$prefix||str_starts_with($url,$prefix.'#')||str_starts_with($url,$prefix.'?')){$tags->set_attribute($attr,$new.substr($url,strlen($prefix)));break;}}} return $tags->get_updated_html(); }add_filter('the_content','baa_growth_versioned_code_links',29);