Content Rendering
render_content_html(string $html, array $item = null): string
Full rich content rendering with complete shortcode parsing (galleries, TOC, callouts, quotes, buttons, recent_articles, recent_projects, contact_form…). When $item['content_format'] === 'markdown', converts Markdown to HTML first, then runs the shortcode pipeline.
Never display $item['content'] directly — always pass through this function.
echo render_content_html($item['content'] ?? '', $item);
render_site_logo(array $settings, string $class = '', string $alt = ''): string
Returns an <img> tag for the site logo configured in settings. Returns empty string if no logo is set.
echo render_site_logo($settings, 'site-logo');
render_site_favicon(array $settings): string
Returns the <link rel="icon"> tag for the configured favicon. Returns empty string if none is set. Detects MIME type from file extension (ico, svg, png, gif, webp).
render_site_title(array $settings, string $pageTitle): string
Returns the site title string for use in the header, respecting the show_site_title_in_header setting.
render_content_title(array $item): string
Returns the <h1> title block. Returns empty string if show_title is false.
render_meta_tags(array $settings, string $metaTitle, string $metaDescription, array $pageData = null): string
Generates all SEO tags: description, Open Graph, canonical URL, and JSON-LD schema.org markup.
render_header_scripts(array $headerScripts): string
Injects all <script> and <link> tags into the <head>. Call once only in header.php.
Injection order:
<base>tagcss/synaptikCSS.php(combined system CSS)theme/{active}/css/style.css(with?v=mtimecache busting)js/main.js(with?v=mtimecache busting)- RSS feed
<link> $headerScripts(conditional gallery scripts,window.appSettings, etc.)theme/{active}/js/script.js(deferred, if file exists)window.CMS_LANGi18n bridge
render_featured_image(array $item): string
Returns the <div class="featured-image"> block. Returns empty string if no image is set or show_featured_image is false.
render_content_date(array $item): string
Returns the publication date block if show_date is enabled, formatted per date_format.
render_content_category(array $item): string
Returns the category badge link. Returns empty string if no category is set.
render_content_tags(array $item): string
Returns the tag links block. Returns empty string if no tags are set.
render_content_gallery(array $item): string
Returns the legacy gallery block from $item['gallery']. For inline galleries defined in $item['galleries'], use [gallery id="N"] shortcodes inside content.
render_footer_content(): string
Returns the footer text (supports {year} placeholder) and optional social links.
Article & project cards
render_article_card(array $article): string
Delegates to partials/article-card.php if it exists in the active theme; uses built-in default otherwise.
render_project_card(array $project): string
Delegates to partials/project-card.php if it exists; uses built-in default otherwise.
get_article_summary(array $article, int $length = 150): string
Returns an HTML-safe summary. Uses $article['summary'] if defined; otherwise auto-generates a clean excerpt via _clean_excerpt(). Loads the full item on demand if content is absent (index-mode context). Ready for direct echo.
echo get_article_summary($article);
echo get_article_summary($article, 200); // Custom length
Related items
render_related_items(array $item, int $limit = 5): string
Renders a related content section for a full content item. Returns empty string if $item['show_related_items'] is not true.
Manual mode — if $item['related_items'] is a non-empty array of {type, slug} references, those exact items are resolved and displayed.
Auto mode — if related_items is empty, candidates across all types are scored by shared tags (+1 each) and matching category (+2). The top-scoring items up to $limit are returned. Only reads index data — no full item files loaded.
// In content-articles.php or content-pages.php
echo render_related_items($item);
echo render_related_items($item, 3); // Limit auto mode to 3
Homepage sections
render_home_articles(array $data, array $settings): string
Generates the article grid for the homepage with pagination. Respects show_articles_on_homepage, articles_per_page, and per-article show_on_homepage.
render_home_projects(array $data, array $settings): string
Generates the project grid for the homepage. Respects show_projects_on_homepage and projects_per_page.
Search
render_search_ui(): string
Generates the full HTML for the search overlay (#search-overlay). Always generated regardless of show_search_icon — ensures Ctrl+K works even when the icon is hidden. Call before </body>.
render_search_icon(): string
Generates the <li> search icon for the navigation bar. Returns empty string if show_search_icon is false.
get_search_icon_html(): string
Legacy alias for render_search_icon().
get_search_overlay_html(): string
Legacy alias for render_search_ui().
Galleries
renderGallery(array $galleryItems, string $layout = 'grid'): string
Dispatches to the appropriate gallery renderer. Supported layouts: 'grid', 'masonry', 'justified', 'carousel'.
renderGridGallery(array $galleryItems, string $galleryId): string
Fixed-column grid with lightbox support.
renderMasonryGallery(array $galleryItems, string $galleryId): string
Masonry (Pinterest-style) with lightbox support.
renderJustifiedGallery(array $galleryItems, string $galleryId): string
Justified rows with lightbox support.
renderCarouselGallery(array $galleryItems, string $galleryId): string
Scrollable carousel with previous/next controls.
getGalleryScripts(string $galleryLayout): string
Returns the inline JS/CSS required for a given gallery layout.
Navigation & menus
render_menu(array $settings, array $data): string
Generates the main navigation. Uses custom menu if use_custom_menu is enabled; otherwise calls renderDefaultMenu().
renderHierarchicalMenu(array $settings, array $data): string
Hierarchical menu with dropdown sub-menu support.
renderDefaultMenu(array $data): string
Flat or grouped auto-menu from content marked show_in_menu, sorted by default_menu_order setting. Always reloads fresh indices via sl_load_index() — never reads $data directly.
Contact form
render_contact_form_html(): string
Full contact form with CSRF protection, honeypot, rate limiting, and optional hCaptcha. Injects contact.css once per page via a static flag. Callable directly in templates or via [contact_form].
Breadcrumbs
getBreadcrumbs(string $type, string $slug = '', string $title = '', string $category = ''): string
Generates HTML breadcrumbs for any page type. Category links resolve the full hierarchical path.
Pagination
get_pagination(int $total_items, int $items_per_page, int $current_page, string $type): string
Generates HTML pagination links. Returns empty string if only one page.
echo get_pagination(count($articles), $settings['articles_per_page'], $currentPage, 'article');
