Standard WordPress Installation durchführen mit deutscher Sprache.
Erstellen Sie ein Child-Theme oder verwenden Sie ein bestehendes Theme wie "Astra" oder "GeneratePress".
/* Theme Name: Landart Theme URI: https://landart-verein.de Description: Custom Theme für Landart Künstlerverein Author: Ihr Name Author URI: https://ihre-website.de Version: 1.0 Text Domain: landart */
<?php
// Theme Support
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_theme_support('html5', ['search-form', 'comment-form', 'comment-list', 'gallery', 'caption']);
// Menüs registrieren
register_nav_menus([
'primary' => __('Hauptmenü', 'landart'),
'footer' => __('Footermenü', 'landart')
]);
// Styles und Scripts
function landart_scripts() {
// Haupt-Stylesheet
wp_enqueue_style('landart-style', get_stylesheet_uri());
// Google Fonts
wp_enqueue_style('landart-fonts', 'https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Raleway:wght@300;400;600&display=swap');
// Font Awesome
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
// Tailwind CSS
wp_enqueue_style('tailwind', 'https://cdn.tailwindcss.com');
}
add_action('wp_enqueue_scripts', 'landart_scripts');
// Custom Post Types
function landart_custom_post_types() {
// Künstler
register_post_type('kuenstler',
[
'labels' => [
'name' => __('Künstler', 'landart'),
'singular_name' => __('Künstler', 'landart')
],
'public' => true,
'has_archive' => true,
'rewrite' => ['slug' => 'kuenstler'],
'supports' => ['title', 'editor', 'thumbnail', 'excerpt'],
'menu_icon' => 'dashicons-art'
]
);
// Veranstaltungen
register_post_type('veranstaltungen',
[
'labels' => [
'name' => __('Veranstaltungen', 'landart'),
'singular_name' => __('Veranstaltung', 'landart')
],
'public' => true,
'has_archive' => true,
'rewrite' => ['slug' => 'veranstaltungen'],
'supports' => ['title', 'editor', 'thumbnail', 'excerpt'],
'menu_icon' => 'dashicons-calendar'
]
);
}
add_action('init', 'landart_custom_post_types');
?>
Erstellen Sie folgende Feldgruppen mit Advanced Custom Fields:
Erstellen Sie folgende Hauptseiten:
<?php get_header(); ?>
<section class="hero-image h-96 flex items-center justify-center text-white"
style="background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('<?php echo get_template_directory_uri(); ?>/assets/images/hero.jpg');">
<div class="text-center px-4">
<h1 class="text-4xl md:text-5xl font-bold mb-4"><?php bloginfo('name'); ?></h1>
<p class="text-xl mb-8">Kunst in und mit der Natur - seit 1995</p>
<a href="/mitgliedschaft" class="bg-green-700 hover:bg-green-800 text-white px-6 py-3 rounded-full font-medium transition duration-300">
Jetzt Mitglied werden
</a>
</div>
</section>
<section class="py-16 bg-white">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row items-center">
<div class="md:w-1/2 mb-8 md:mb-0 md:pr-8">
<h2 class="text-3xl font-bold text-gray-800 mb-6">Über unseren Verein</h2>
<?php
$about_page = get_page_by_path('ueber-uns');
echo apply_filters('the_content', $about_page->post_excerpt);
?>
<a href="/ueber-uns" class="text-green-700 font-medium hover:underline">
Mehr erfahren <i class="fas fa-arrow-right ml-2"></i>
</a>
</div>
<div class="md:w-1/2">
<div class="grid grid-cols-2 gap-4">
<?php
$gallery_images = get_field('homepage_gallery', 'option');
if($gallery_images):
foreach($gallery_images as $image): ?>
<div class="h-48 bg-gray-200 rounded-lg overflow-hidden">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" class="w-full h-full object-cover">
</div>
<?php endforeach;
endif; ?>
</div>
</div>
</div>
</div>
</section>
<section class="py-16 bg-gray-100">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center text-gray-800 mb-12">Unsere Künstler</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<?php
$artists = new WP_Query([
'post_type' => 'kuenstler',
'posts_per_page' => 3,
'orderby' => 'rand'
]);
if($artists->have_posts()):
while($artists->have_posts()): $artists->the_post(); ?>
<div class="bg-white rounded-lg overflow-hidden shadow-md hover:shadow-lg transition duration-300">
<div class="h-64 bg-gray-200 relative">
<?php if(has_post_thumbnail()): ?>
<?php the_post_thumbnail('full', ['class' => 'w-full h-full object-cover']); ?>
<?php endif; ?>
<div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black to-transparent p-4">
<h3 class="text-white text-xl font-bold"><?php the_title(); ?></h3>
<p class="text-gray-300"><?php the_field('spezialisierung'); ?></p>
</div>
</div>
<div class="p-6">
<p class="text-gray-600 mb-4"><?php echo wp_trim_words(get_the_excerpt(), 20); ?></p>
<a href="<?php the_permalink(); ?>" class="text-green-700 font-medium hover:underline">Portfolio ansehen</a>
</div>
</div>
<?php endwhile;
wp_reset_postdata();
endif; ?>
</div>
<div class="text-center mt-12">
<a href="/kuenstler" class="inline-block bg-green-700 hover:bg-green-800 text-white px-6 py-3 rounded-full font-medium transition duration-300">
Alle Künstler entdecken
</a>
</div>
</div>
</section>
<?php get_footer(); ?>
Falls der Verein regionale Gruppen hat, können Sie ein WordPress Multisite-Netzwerk einrichten:
/* That's all, stop editing! Happy blogging. */ folgendes einfügen:
define('WP_ALLOW_MULTISITE', true);