| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web10/web/wp-content/themes/standardtheme/ |
Upload File : |
<?php
/**
* Standard Theme functions and definitions.
*
* @package StandardTheme
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Direktzugriff verhindern.
}
if ( ! defined( 'STANDARDTHEME_VERSION' ) ) {
define( 'STANDARDTHEME_VERSION', '1.0.0' );
}
/**
* Theme-Grundeinstellungen.
*/
function standardtheme_setup() {
// Lässt WordPress den <title> verwalten.
add_theme_support( 'title-tag' );
// Beitragsbilder (Featured Images).
add_theme_support( 'post-thumbnails' );
// Automatische Feed-Links im <head>.
add_theme_support( 'automatic-feed-links' );
// HTML5-Markup für Kernbereiche.
add_theme_support(
'html5',
array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script' )
);
// Logo / Custom Header / Background.
add_theme_support( 'custom-logo' );
add_theme_support( 'customize-selective-refresh-widgets' );
// Block-Editor-Stile.
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'align-wide' );
// Navigationsmenüs.
register_nav_menus(
array(
'primary' => __( 'Hauptmenü', 'standardtheme' ),
'footer' => __( 'Footer-Menü', 'standardtheme' ),
)
);
}
add_action( 'after_setup_theme', 'standardtheme_setup' );
/**
* Inhaltsbreite.
*/
function standardtheme_content_width() {
$GLOBALS['content_width'] = 760;
}
add_action( 'after_setup_theme', 'standardtheme_content_width', 0 );
/**
* Styles & Scripts laden.
*/
function standardtheme_scripts() {
wp_enqueue_style( 'standardtheme-style', get_stylesheet_uri(), array(), STANDARDTHEME_VERSION );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'standardtheme_scripts' );
/**
* Widget-Bereiche registrieren.
*/
function standardtheme_widgets_init() {
register_sidebar(
array(
'name' => __( 'Seitenleiste', 'standardtheme' ),
'id' => 'sidebar-1',
'description' => __( 'Widgets in der rechten Seitenleiste.', 'standardtheme' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'standardtheme_widgets_init' );
/**
* Fallback-Menü, falls noch kein Menü zugewiesen wurde:
* gibt die Seiten als Liste aus, damit sofort Navigation sichtbar ist.
*/
function standardtheme_page_menu_fallback() {
wp_page_menu(
array(
'show_home' => __( 'Startseite', 'standardtheme' ),
'menu_class' => 'menu',
)
);
}