Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 383328a6b6 | |||
| 1ad6eda924 | |||
| eade5d7bf6 | |||
| 9df80d7237 | |||
| 27f6a15aae | |||
| 638808d9dd | |||
| ca9815ea65 | |||
| 568acd83d1 | |||
| 985ba164a1 | |||
| 77536986ab | |||
| 39e9b298d9 | |||
| 37b31a6109 | |||
| b7276ff373 | |||
| 02b94594b9 | |||
| d76950645e | |||
| dbea7c74f3 | |||
| ae10138d51 | |||
| 991d9c38c8 | |||
| 4ad76fabf6 | |||
| d46684dc7e | |||
| dc14b838d6 | |||
| f397108cf0 | |||
| 6896f6aa26 | |||
| e119411758 | |||
| 50c636a17f | |||
| 9051f74598 | |||
| 777a999fed | |||
| d27c2b1259 | |||
| cc36e57079 | |||
| ca6955d579 | |||
| ddbf78a5c0 | |||
| b3638449ea | |||
| 863deb2592 | |||
| c7e8703787 | |||
| 39f1d87475 | |||
| ae3795337e | |||
| 43be3dd783 | |||
| afcabb0f10 | |||
| 99e9d76c97 | |||
| 91586b8cee | |||
| 156030f70d | |||
| 603cc0a430 | |||
| 23b93ec177 | |||
| 839b1a2e85 | |||
| b0d7f44d9a | |||
| fab5f1464c | |||
| 6b8301bff5 | |||
| a316e6a6dd | |||
| d334704927 | |||
| 5004c0072c | |||
| 250d00aa20 | |||
| 519c7c6b52 | |||
| 8499b29174 | |||
| b62c52cfad | |||
| 57e758353a | |||
| ae4ec1dc30 | |||
| aabc4e37e5 | |||
| d5baf0cadb | |||
| 4b28dc465d | |||
| 9a36bd94d0 | |||
| 33a1fe6848 | |||
| f1eabc1c9d | |||
| ad1ff1843b | |||
| 9fe45108d8 | |||
| f315469c41 | |||
| 5987417f36 | |||
| 79b798d5fe | |||
| ea1331c266 | |||
| 903333cac3 | |||
| 446e08dc91 | |||
| 231cf8fc6c | |||
| 2f93e98220 | |||
| 43f19e926a | |||
| 41e46b8804 | |||
| aa07d5bda3 | |||
| 76218121a4 | |||
| 04424d7f59 | |||
| 98640766c6 | |||
| 3e911e5ab7 | |||
| 036fa2be08 | |||
| efdda0d8ed | |||
| 1b961d75bd | |||
| 8144180b8b | |||
| 5a6a035fe1 | |||
| 7cd7abdead | |||
| e87c3f6f97 | |||
| f25fbf3869 | |||
| 32bbb0b36f | |||
| 75af878db9 | |||
| 88dd9e8c45 | |||
| 5be3e02b7d | |||
| 91df9b2f6f | |||
| f9753124e1 | |||
| 4bfd56887c | |||
| 12c762794b |
117
LICENSE
117
LICENSE
@@ -1,117 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
|
||||
@@ -1,42 +1,74 @@
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// === 1. Stylesheets korrekt laden ===
|
||||
function child_theme_enqueue_styles() {
|
||||
// Lädt das Stylesheet des Parent Themes
|
||||
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
|
||||
|
||||
// Lädt das Stylesheet des Child Themes (abhängig vom Parent-Style)
|
||||
wp_enqueue_style( 'child-style',
|
||||
get_stylesheet_directory_uri() . '/style.css',
|
||||
array( 'parent-style' ),
|
||||
wp_get_theme()->get('Version')
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );
|
||||
|
||||
|
||||
// === 2. Nur das FAQ-Skript austauschen ===
|
||||
function child_theme_swap_faq_script() {
|
||||
// Entfernt das Skript, das das Parent Theme geladen hat
|
||||
wp_deregister_script( 'faq-accordion-script' );
|
||||
|
||||
// Lädt Ihr neues, verbessertes Skript aus dem Child Theme
|
||||
// Wir verwenden den gleichen Namen ('Handle'), um Konflikte zu vermeiden
|
||||
wp_enqueue_script(
|
||||
'faq-accordion-script', // Gleicher Name wie im Parent Theme
|
||||
get_stylesheet_directory_uri() . '/js/faq-accordion.js', // Pfad zur neuen JS-Datei
|
||||
array( 'jquery' ),
|
||||
'1.0',
|
||||
true
|
||||
);
|
||||
}
|
||||
// Diese Funktion wird mit einer höheren Priorität (20) ausgeführt,
|
||||
// also NACHDEM das Parent Theme sein Skript geladen hat.
|
||||
add_action( 'wp_enqueue_scripts', 'child_theme_swap_faq_script', 20 );
|
||||
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* =============================================================================
|
||||
* HAUPTFUNKTION: Stylesheets korrekt laden
|
||||
* =============================================================================
|
||||
*
|
||||
* Diese Funktion lädt das Stylesheet des Parents zuerst.
|
||||
* Danach wird das Stylesheet des Childs geladen.
|
||||
* So können CSS-Regeln im Child Theme das Parent Theme gezielt überschreiben.
|
||||
*/
|
||||
function minecraft_modern_child_enqueue_styles() {
|
||||
// 1. Das Stylesheet des Parent Themes laden
|
||||
// get_template_directory_uri() zeigt auf den Ordner des Parent Themes.
|
||||
// Der Handle 'minecraft-modern-style' sollte exakt dem im Parent übereinstimmen.
|
||||
$parent_style = 'minecraft-modern-style';
|
||||
|
||||
wp_enqueue_style(
|
||||
$parent_style,
|
||||
get_template_directory_uri() . '/style.css',
|
||||
array(),
|
||||
wp_get_theme( get_template() )->get( 'Version' ) // WICHTIG: Wir nutzen die Version des Parents
|
||||
);
|
||||
|
||||
// 2. Das Stylesheet des Child Themes laden
|
||||
// get_stylesheet_directory_uri() zeigt auf den Ordner des Child Themes.
|
||||
// Die Abhängigkeit 'parent-style' stellt sicher, dass es NACH dem Parent geladen wird.
|
||||
wp_enqueue_style(
|
||||
'minecraft-modern-child-style',
|
||||
get_stylesheet_directory_uri() . '/style.css',
|
||||
array( $parent_style ),
|
||||
wp_get_theme()->get( 'Version' ) // Die Version des Childs (für Cache-Reset)
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'minecraft_modern_child_enqueue_styles' );
|
||||
|
||||
|
||||
/**
|
||||
* =============================================================================
|
||||
* (OPTIONAL) Beispiel: Ein Skript des Parent Themes überschreiben
|
||||
* =============================================================================
|
||||
*
|
||||
* Falls du die Logik des Sliders (z.B. die slider-init.js) im Child Theme
|
||||
* anpassen möchtest, könntest du diese Technik nutzen.
|
||||
* Dies ist NUR NOTWENDIG, wenn du Änderungen am JavaScript des Sliders vornehmen willst.
|
||||
*
|
||||
* Um dies zu aktivieren, entferne die Slashs (/) am Anfang und Ende dieses Blocks.
|
||||
*/
|
||||
/*
|
||||
function minecraft_modern_child_swap_faq_script() {
|
||||
// Entfernt das Skript, das vom Parent Theme mit dem Handle 'faq-accordion-script' registriert wurde.
|
||||
wp_deregister_script( 'faq-accordion-script' );
|
||||
|
||||
// Lädt dein neues Skript aus dem Child Theme.
|
||||
// Wir verwenden denselben Namen ('Handle'), um WordPress klar zu machen,
|
||||
// dass dieses Skript das Original ersetzt.
|
||||
wp_enqueue_script(
|
||||
'faq-accordion-script', // Derselbe Handle wie im Parent Theme
|
||||
get_stylesheet_directory_uri() . '/js/faq-accordion.js', // Pfad zur neuen JS-Datei im Child Theme
|
||||
array( 'jquery' ), // Abhängigkeiten (hier jQuery)
|
||||
'1.0', // Version deines Skripts
|
||||
true // Im Footer laden
|
||||
);
|
||||
}
|
||||
// Diese Funktion wird mit einer höheren Priorität (20) ausgeführt,
|
||||
// also NACHDEM das Parent Theme sein Skript geladen hat.
|
||||
add_action( 'wp_enqueue_scripts', 'minecraft_modern_child_swap_faq_script', 20 );
|
||||
*/
|
||||
?>
|
||||
BIN
Minecraft-Modern-Theme-Child/screenshot.PNG
Normal file
BIN
Minecraft-Modern-Theme-Child/screenshot.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
@@ -1,40 +1,55 @@
|
||||
/*
|
||||
Theme Name: Minecraft Modern Theme Child
|
||||
Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
|
||||
Description: Ein Child Theme für das Minecraft Modern Theme.
|
||||
Author: M_Viper
|
||||
Author URI: https://M-Viper.de
|
||||
Template: minecraft-modern-theme
|
||||
Version: 1.0.0
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: minecraft-modern-theme-child
|
||||
*/
|
||||
|
||||
/* =Hier kommen Ihre CSS-Anpassungen hin
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Kopieren Sie Ihre geänderten CSS-Regeln hierhin.
|
||||
Zum Beispiel die neuen Regeln für die FAQ-Tabs:
|
||||
*/
|
||||
.faq-tab-content-container {
|
||||
display: grid; /* Wichtig: Erzeugt ein Gitter-Layout */
|
||||
/* Alle direkten Kinder (.faq-tab-pane) werden automatisch auf die gleiche Höhe gesetzt */
|
||||
}
|
||||
|
||||
.faq-tab-pane {
|
||||
/* Grid-Item-Styling */
|
||||
grid-area: 1 / 1 / 2 / 2; /* Alle Panes belegen dieselbe Gitterzelle */
|
||||
|
||||
/* Visuelles Ein- und Ausblenden */
|
||||
opacity: 0; /* Standardmäßig unsichtbar */
|
||||
pointer-events: none; /* Nicht klickbar, wenn unsichtbar */
|
||||
transition: opacity 0.4s ease-in-out;
|
||||
}
|
||||
|
||||
.faq-tab-pane.active {
|
||||
opacity: 1; /* Sichtbar machen */
|
||||
pointer-events: auto; /* Wieder klickbar machen */
|
||||
}
|
||||
|
||||
/*
|
||||
Theme Name: Minecraft Modern Theme Child
|
||||
Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
|
||||
Description: Ein Child Theme für das Minecraft Modern Theme.
|
||||
Author: M_Viper
|
||||
Author URI: https://M-Viper.de
|
||||
Template: Minecraft-Modern-Theme
|
||||
Version: 1.1.0
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: minecraft-modern-theme-child
|
||||
*/
|
||||
|
||||
/* =Hier kommen Ihre CSS-Anpassungen hin
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
/* Kopieren Sie Ihre geänderten CSS-Regeln hierhin.
|
||||
Zum Beispiel die neuen Regeln für die FAQ-Tabs:
|
||||
*/
|
||||
.faq-tab-content-container {
|
||||
display: grid; /* Wichtig: Erzeugt ein Gitter-Layout */
|
||||
/* Alle direkten Kinder (.faq-tab-pane) werden automatisch auf die gleiche Höhe gesetzt */
|
||||
}
|
||||
|
||||
.faq-tab-pane {
|
||||
/* Grid-Item-Styling */
|
||||
grid-area: 1 / 1 / 2 / 2; /* Alle Panes belegen dieselbe Gitterzelle */
|
||||
|
||||
/* Visuelles Ein- und Ausblenden */
|
||||
opacity: 0; /* Standardmäßig unsichtbar */
|
||||
pointer-events: none; /* Nicht klickbar, wenn unsichtbar */
|
||||
transition: opacity 0.4s ease-in-out;
|
||||
}
|
||||
|
||||
.faq-tab-pane.active {
|
||||
opacity: 1; /* Sichtbar machen */
|
||||
pointer-events: auto; /* Wieder klickbar machen */
|
||||
}
|
||||
|
||||
/* ===================================================================
|
||||
LAYOUT-SHIFT-FIX: Slider verstecken, bis er initialisiert ist
|
||||
=================================================================== */
|
||||
.hero-slider {
|
||||
/* Verstecke den Slider initial, um ein "Zusammenschnappen" zu verhindern */
|
||||
opacity: 0;
|
||||
/* Füge einen sanften Übergangseffekt für das Einblenden hinzu */
|
||||
transition: opacity 0.4s ease-in-out;
|
||||
}
|
||||
|
||||
/* Diese Klasse wird vom JavaScript hinzugefügt, wenn der Slider bereit ist */
|
||||
.hero-slider.swiper-initialized {
|
||||
/* Mache den Slider sichtbar */
|
||||
opacity: 1;
|
||||
}
|
||||
/* Fügen Sie hier zukünftig weiteres eigenes CSS hinzu */
|
||||
47
Minecraft-Modern-Theme/archive-team.php
Normal file
47
Minecraft-Modern-Theme/archive-team.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div class="container site-main">
|
||||
<div class="content-area">
|
||||
<div class="team-archive-container">
|
||||
<header class="page-header">
|
||||
<h1 class="page-title">Unser Team</h1>
|
||||
<p class="page-description">Lerne die Leute kennen, die diesen Server am Laufen halten.</p>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
$query = new WP_Query(array('post_type' => 'team_member', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'));
|
||||
if ( $query->have_posts() ) : ?>
|
||||
<div class="team-grid">
|
||||
<?php while ( $query->have_posts() ) : $query->the_post();
|
||||
$rank_string = get_post_meta( get_the_ID(), '_team_member_rank', true );
|
||||
$img = get_the_post_thumbnail_url( get_the_ID(), 'medium' );
|
||||
if ( !$img ) $img = get_template_directory_uri() . '/images/default-avatar.png';
|
||||
?>
|
||||
<article class="team-card">
|
||||
<div class="team-image-wrapper">
|
||||
<img src="<?php echo esc_url($img); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">
|
||||
</div>
|
||||
<div class="team-info">
|
||||
<h3 class="team-name"><?php the_title(); ?></h3>
|
||||
<div class="team-ranks-wrapper">
|
||||
<?php if ( !empty($rank_string) ) {
|
||||
$ranks = explode(',', $rank_string);
|
||||
foreach ( $ranks as $r ) {
|
||||
echo '<span class="team-rank">' . esc_html(trim($r)) . '</span>';
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
<div class="team-bio"><?php the_excerpt(); ?></div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php else : ?>
|
||||
<p>Noch keine Teammitglieder.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
276
Minecraft-Modern-Theme/css/login-style.css
Normal file
276
Minecraft-Modern-Theme/css/login-style.css
Normal file
@@ -0,0 +1,276 @@
|
||||
/* Minecraft Modern Theme Login & Registrierungs-Styles */
|
||||
body.login, body.login-action-register {
|
||||
background-color: #14151a; /* Fallback-Farbe */
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
font-family: 'Raleway', sans-serif;
|
||||
}
|
||||
|
||||
/* Dunkler Overlay für bessere Lesbarkeit */
|
||||
body.login::before, body.login-action-register::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(20, 21, 26, 0.8);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/* Logo zentrieren */
|
||||
body.login h1, body.login-action-register h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
body.login h1 a, body.login-action-register h1 a {
|
||||
width: auto;
|
||||
height: 160px;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
/* Haupt-Container, der alles umschließt */
|
||||
body.login #login, body.login-action-register #login {
|
||||
width: 80%;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Der Wrapper, der vom Skript erstellt wird. */
|
||||
body.login #login-content-wrapper, body.login-action-register #login-content-wrapper {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
background-color: #252830;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Linke Spalte: Minecraft Avatar Slider (27.8%) */
|
||||
body.login #minecraft-avatar-slider, body.login-action-register #minecraft-avatar-slider {
|
||||
flex: 0 0 27.8%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
padding-top: 50px;
|
||||
background-color: #1a1c23;
|
||||
height: auto;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body.login #minecraft-avatar-slider .avatar-slide, body.login-action-register #minecraft-avatar-slider .avatar-slide {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 400px;
|
||||
border-radius: 4px;
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
transition: opacity 0.7s ease-in-out;
|
||||
}
|
||||
|
||||
body.login #minecraft-avatar-slider .avatar-slide-active, body.login-action-register #minecraft-avatar-slider .avatar-slide-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Rechte Spalte: Login/Registrierungs-Formular (72.2%) */
|
||||
body.login #loginform, body.login-action-register #registerform, body.login #loginform, body.login-action-register #registerform {
|
||||
flex: 1;
|
||||
padding: 40px;
|
||||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Formular-Felder */
|
||||
body.login #loginform p, body.login-action-register #registerform p,
|
||||
body.login #loginform label, body.login-action-register #registerform label {
|
||||
margin-bottom: 20px;
|
||||
color: #e4e4e4;
|
||||
font-weight: 600;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
body.login #loginform input[type="text"], body.login #loginform input[type="password"], body.login-action-register #registerform input[type="text"], body.login-action-register #registerform input[type="password"], body.login #loginform input[type="email"], body.login-action-register #registerform input[type="email"] {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
background-color: #1e2029;
|
||||
border: 1px solid #333;
|
||||
border-radius: 4px;
|
||||
color: #e4e4e4;
|
||||
font-family: 'Raleway', sans-serif;
|
||||
font-size: 16px;
|
||||
transition: border-color 0.3s, box-shadow 0.3s;
|
||||
}
|
||||
|
||||
body.login #loginform input[type="text"]:focus, body.login #loginform input[type="password"]:focus, body.login-action-register #registerform input[type="text"]:focus, body.login-action-register #registerform input[type="password"]:focus, body.login-action-register #registerform input[type="email"]:focus {
|
||||
border-color: #00d4ff;
|
||||
box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* "Angemeldet bleiben" Checkbox (nur Login) */
|
||||
body.login .forgetmenot label, body.login .forgetmenot input[type="checkbox"] {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: #a0a0a0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
body.login .forgetmenot input[type="checkbox"] {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* NEU: Stile für die Registrierungsseite */
|
||||
.auth-title {
|
||||
text-align: center;
|
||||
color: #e4e4e4;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.auth-subtitle {
|
||||
text-align: center;
|
||||
color: #a0a0a0;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.login-form-link {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.login-form-link p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.login-form-link a {
|
||||
color: #00d4ff;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
.login-form-link a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.logged-in-message {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
background-color: #252830;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.logged-in-message h2 {
|
||||
margin-top: 0;
|
||||
color: #00d4ff;
|
||||
}
|
||||
.logged-in-message .button {
|
||||
display: inline-block;
|
||||
margin: 10px;
|
||||
padding: 12px 25px;
|
||||
background-color: #00d4ff;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
.logged-in-message .button:hover {
|
||||
background-color: #00a8cc;
|
||||
}
|
||||
|
||||
/* Container für "Angemeldet bleiben" und "Passwort vergessen" (nur Login) */
|
||||
body.login .login-options-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
body.login .login-options-container .forgetmenot,
|
||||
body.login .login-options-container #nav {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body.login .login-options-container #nav a {
|
||||
color: #a0a0a0;
|
||||
text-decoration: none;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
body.login .login-options-container #nav a:hover {
|
||||
color: #00d4ff;
|
||||
}
|
||||
|
||||
/* Submit-Button (gilt für Login & Registrierung) */
|
||||
body.login #loginform .submit input[type="submit"], body.login-action-register #registerform .submit input[type="submit"] {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
background-color: #00d4ff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
font-family: 'Raleway', sans-serif;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
body.login #loginform .submit input[type="submit"]:hover, body.login-action-register #registerform .submit input[type="submit"]:hover {
|
||||
background-color: #00a8cc;
|
||||
}
|
||||
|
||||
/* Anpassungen für kleinere Bildschirme */
|
||||
@media screen and (max-width: 768px) {
|
||||
body.login #login-content-wrapper, body.login-action-register #login-content-wrapper {
|
||||
flex-direction: column;
|
||||
}
|
||||
body.login #minecraft-avatar-slider, body.login-action-register #minecraft-avatar-slider {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
body.login #minecraft-avatar-slider .avatar-slide, body.login-action-register #minecraft-avatar-slider .avatar-slide {
|
||||
max-height: 300px;
|
||||
max-width: 200px;
|
||||
top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fehlermeldungen und Hinweise */
|
||||
body.login .message, body.login #login_error, body.login-action-register .message, body.login-action-register #login_error {
|
||||
background-color: rgba(0, 212, 255, 0.1);
|
||||
border-left: 4px solid #00d4ff;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
color: #e4e4e4;
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
=== STIL FÜR DIE LINKS UNTER DEM ANMELDE-BUTTON ====================
|
||||
========================================================================= */
|
||||
|
||||
body.login .post-login-links, body.login-action-register .post-login-links {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
border-top: 1px solid #333;
|
||||
}
|
||||
|
||||
body.login .post-login-links a, body.login-action-register .post-login-links a {
|
||||
color: #a0a0a0;
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
body.login .post-login-links a:hover, body.login-action-register .post-login-links a:hover {
|
||||
color: #00d4ff;
|
||||
}
|
||||
@@ -1,74 +1,84 @@
|
||||
<footer id="colophon" class="site-footer">
|
||||
<div class="container">
|
||||
<div class="footer-widgets-container">
|
||||
<div class="footer-widgets">
|
||||
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-3' ); ?></div>
|
||||
<!-- 1. OBERER BEREICH: Widgets -->
|
||||
<div class="footer-widgets">
|
||||
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
|
||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-3' ); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- 2. UNTERER BEREICH: Menü, Copyright, Legal -->
|
||||
<div class="footer-bottom-bar">
|
||||
|
||||
<div class="footer-left-group">
|
||||
<!-- Copyright -->
|
||||
<div class="site-info">
|
||||
<?php
|
||||
$copyright_text = get_theme_mod( 'footer_copyright', '© ' . date('Y') . ' ' . get_bloginfo('name') );
|
||||
|
||||
if ( get_theme_mod('show_footer_credit', true) ) {
|
||||
$full_footer_text = $copyright_text . ' <span class="footer-separator">|</span> <span class="footer-credit">
|
||||
<a href="https://m-viper.de" target="_blank" rel="noopener noreferrer">
|
||||
Minecraft Theme by M_Viper
|
||||
</a>
|
||||
</span>';
|
||||
} else {
|
||||
$full_footer_text = $copyright_text;
|
||||
}
|
||||
echo '<p>' . wp_kses_post( $full_footer_text ) . '</p>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Footer Menü ( falls vorhanden ) -->
|
||||
<?php if ( has_nav_menu( 'footer' ) ) : ?>
|
||||
<nav class="footer-navigation">
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'footer',
|
||||
'menu_class' => 'footer-menu',
|
||||
'container' => false,
|
||||
'depth' => 1, // Nur eine Ebene
|
||||
)
|
||||
);
|
||||
?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( has_nav_menu( 'footer' ) ) : ?>
|
||||
<nav class="footer-navigation">
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'footer',
|
||||
'menu_class' => 'footer-menu',
|
||||
'container' => false,
|
||||
)
|
||||
);
|
||||
?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<div class="site-info">
|
||||
<?php
|
||||
// Den Copyright-Text aus dem Customizer holen
|
||||
$copyright_text = get_theme_mod( 'footer_copyright', '© ' . date('Y') . ' ' . get_bloginfo('name') );
|
||||
|
||||
// Prüfen, ob der Credit angezeigt werden soll
|
||||
if ( get_theme_mod('show_footer_credit', true) ) {
|
||||
// Wenn ja, den Credit-Text mit einem Trennzeichen anhängen
|
||||
$full_footer_text = $copyright_text . ' | <span class="footer-credit">Minecraft Theme Erstellt von M_Viper 2025</span>';
|
||||
} else {
|
||||
// Wenn nein, nur den Copyright-Text verwenden
|
||||
$full_footer_text = $copyright_text;
|
||||
}
|
||||
|
||||
// Den kompletten Text ausgeben
|
||||
echo '<p>' . wp_kses_post( $full_footer_text ) . '</p>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- NEU: Impressum & Datenschutz Links -->
|
||||
<div class="footer-legal-links">
|
||||
<?php
|
||||
$impressum_url = get_theme_mod('footer_impressum_url');
|
||||
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
|
||||
$links = array();
|
||||
<div class="footer-right-group">
|
||||
<!-- Impressum & Datenschutz -->
|
||||
<div class="footer-legal-links">
|
||||
<?php
|
||||
$impressum_url = get_theme_mod('footer_impressum_url');
|
||||
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
|
||||
$links = array();
|
||||
|
||||
if (!empty($impressum_url)) {
|
||||
$links[] = '<a href="' . esc_url($impressum_url) . '">Impressum</a>';
|
||||
}
|
||||
if (!empty($impressum_url)) {
|
||||
$links[] = '<a href="' . esc_url($impressum_url) . '"><i class="fas fa-info-circle"></i> Impressum</a>';
|
||||
}
|
||||
|
||||
if (!empty($datenschutz_url)) {
|
||||
$links[] = '<a href="' . esc_url($datenschutz_url) . '">Datenschutz</a>';
|
||||
}
|
||||
if (!empty($datenschutz_url)) {
|
||||
$links[] = '<a href="' . esc_url($datenschutz_url) . '"><i class="fas fa-shield-alt"></i> Datenschutz</a>';
|
||||
}
|
||||
|
||||
// Nur anzeigen, wenn mindestens ein Link vorhanden ist
|
||||
if (!empty($links)) {
|
||||
echo implode(' | ', $links);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
if (!empty($links)) {
|
||||
echo implode('', $links); // Kein Trennzeichen mehr, da wir Icons haben
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- Ende footer-bottom-bar -->
|
||||
</div> <!-- Ende Container -->
|
||||
|
||||
<!-- Ovaler Dark / Light Mode Toggle mit Sonne & Mond -->
|
||||
<!-- THEME TOGGLE (Fixiert unten rechts) -->
|
||||
<button class="theme-toggle" aria-label="Dark/Light Mode umschalten" title="Dark / Light Mode">
|
||||
<div class="theme-toggle-icons">
|
||||
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
|
||||
@@ -1,80 +1,416 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php
|
||||
// =====================================================
|
||||
// HERO SLIDER ODER HERO SECTION
|
||||
// =====================================================
|
||||
if ( get_theme_mod('slider_enabled', false) ) :
|
||||
?>
|
||||
<section class="hero-slider swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
for ($i = 1; $i <= 5; $i++) :
|
||||
$image_url = get_theme_mod('slider_image_' . $i);
|
||||
if ($image_url) :
|
||||
$title = get_theme_mod('slider_title_' . $i);
|
||||
$subtitle = get_theme_mod('slider_subtitle_' . $i);
|
||||
for ( $i = 1; $i <= 5; $i++ ) :
|
||||
$image_url = get_theme_mod( 'slider_image_' . $i );
|
||||
if ( $image_url ) :
|
||||
$title = get_theme_mod( 'slider_title_' . $i );
|
||||
$subtitle = get_theme_mod( 'slider_subtitle_' . $i );
|
||||
?>
|
||||
<div class="swiper-slide" style="background-image: url('<?php echo esc_url($image_url); ?>');">
|
||||
<div class="slider-content">
|
||||
<?php if ($title) : ?>
|
||||
<h2 class="slider-title"><?php echo esc_html($title); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php if ($subtitle) : ?>
|
||||
<p class="slider-subtitle"><?php echo esc_html($subtitle); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="swiper-slide" style="background-image: url('<?php echo esc_url( $image_url ); ?>');">
|
||||
<div class="slider-content">
|
||||
<?php if ( $title ) : ?>
|
||||
<h2 class="slider-title"><?php echo esc_html( $title ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $subtitle ) : ?>
|
||||
<p class="slider-subtitle"><?php echo esc_html( $subtitle ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endfor;
|
||||
?>
|
||||
</div>
|
||||
<div class="swiper-pagination"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
|
||||
<?php if ( ! get_theme_mod( 'slider_hide_pagination', false ) ) : ?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! get_theme_mod( 'slider_hide_arrows', false ) ) : ?>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<!-- ================================================= -->
|
||||
<!-- ANNOUNCEMENT ANKER (unter Slider, ohne Scroll-Bug) -->
|
||||
<!-- ================================================= -->
|
||||
<div id="mm-announcement-anchor"></div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<?php
|
||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||
?>
|
||||
<section class="hero-section" style="<?php echo $hero_bg ? "background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('" . esc_url($hero_bg) . "')" : ''; ?>">
|
||||
|
||||
<section class="hero-section"
|
||||
style="<?php
|
||||
echo $hero_bg
|
||||
? "background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('" . esc_url( $hero_bg ) . "')"
|
||||
: '';
|
||||
?>">
|
||||
<div class="container">
|
||||
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
||||
<h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html( $hero_subtitle ); ?></p>
|
||||
|
||||
<div class="hero-buttons">
|
||||
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
||||
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
||||
<a href="<?php echo esc_url( $btn1_url ); ?>" class="hero-button-1">
|
||||
<?php echo esc_html( $btn1_text ); ?>
|
||||
</a>
|
||||
<a href="<?php echo esc_url( $btn2_url ); ?>" class="hero-button-2">
|
||||
<?php echo esc_html( $btn2_text ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ================================================= -->
|
||||
<!-- ANNOUNCEMENT ANKER (unter Hero, ohne Scroll-Bug) -->
|
||||
<!-- ================================================= -->
|
||||
<div id="mm-announcement-anchor"></div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- MAIN CONTENT MIT SIDEBAR -->
|
||||
<!-- ===================================================== -->
|
||||
<main id="primary" class="site-main">
|
||||
<div class="container">
|
||||
<div class="content-area">
|
||||
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
||||
|
||||
<?php
|
||||
// Hole Sidebar-Einstellungen
|
||||
$sidebar_enabled = get_theme_mod( 'homepage_sidebar_enabled', false );
|
||||
$sidebar_position = get_theme_mod( 'homepage_sidebar_position', 'right' );
|
||||
|
||||
// Prüfe ob mindestens ein Sidebar-Bereich aktiv ist
|
||||
$has_sidebar_content = (
|
||||
is_active_sidebar( 'homepage-sidebar-top' ) ||
|
||||
is_active_sidebar( 'homepage-sidebar-middle-1' ) ||
|
||||
is_active_sidebar( 'homepage-sidebar-middle-2' ) ||
|
||||
is_active_sidebar( 'homepage-sidebar-bottom' ) ||
|
||||
is_active_sidebar( 'homepage-sidebar-extra' )
|
||||
);
|
||||
|
||||
// Setze CSS-Klassen basierend auf Sidebar-Status
|
||||
$content_class = 'content-area';
|
||||
if ( $sidebar_enabled && $has_sidebar_content ) {
|
||||
$content_class = 'content-area with-sidebar sidebar-' . esc_attr( $sidebar_position );
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr( $content_class ); ?>">
|
||||
|
||||
<?php if ( $sidebar_enabled && $sidebar_position === 'left' && $has_sidebar_content ) : ?>
|
||||
<!-- SIDEBAR LINKS -->
|
||||
<aside class="homepage-sidebar sidebar-left">
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-top">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="post-content">
|
||||
<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||
<div class="post-excerpt">
|
||||
<?php the_excerpt(); ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-middle-1">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; else : ?>
|
||||
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-middle-2">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-bottom">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-extra">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- HAUPTINHALT -->
|
||||
<div class="main-content">
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
|
||||
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="post-thumbnail">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php the_post_thumbnail( 'medium_large' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="post-content">
|
||||
<h2 class="post-title">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php the_title(); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<div class="post-full-content">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
|
||||
<?php endwhile; ?>
|
||||
<?php else : ?>
|
||||
|
||||
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $sidebar_enabled && $sidebar_position === 'right' && $has_sidebar_content ) : ?>
|
||||
<!-- SIDEBAR RECHTS -->
|
||||
<aside class="homepage-sidebar sidebar-right">
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-top">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-middle-1">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-middle-2">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-bottom">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
|
||||
<div class="sidebar-section sidebar-extra">
|
||||
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- ===================================================== -->
|
||||
<!-- ZUSÄTZLICHES CSS FÜR SIDEBAR LAYOUT -->
|
||||
<!-- ===================================================== -->
|
||||
<style>
|
||||
/* Content ohne Sidebar - volle Breite */
|
||||
.content-area .main-content {
|
||||
width: 100%;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
/* Container mit Sidebar-Layout */
|
||||
.content-area.with-sidebar {
|
||||
display: grid;
|
||||
gap: 30px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
/* Sidebar rechts (Standard) */
|
||||
.content-area.with-sidebar.sidebar-right {
|
||||
grid-template-columns: 1fr 300px;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar.sidebar-right .main-content {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar.sidebar-right .homepage-sidebar {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
/* Sidebar links */
|
||||
.content-area.with-sidebar.sidebar-left {
|
||||
grid-template-columns: 300px 1fr;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar.sidebar-left .homepage-sidebar {
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar.sidebar-left .main-content {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
/* Entfernt das Sticky-Verhalten der Sidebar komplett */
|
||||
.homepage-sidebar {
|
||||
position: relative !important;
|
||||
top: auto !important;
|
||||
background: var(--card-background, #1e2029);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
max-height: calc(200vh - 10vh);
|
||||
}
|
||||
|
||||
/* Sidebar Sections - Bereiche innerhalb der Sidebar */
|
||||
.homepage-sidebar .sidebar-section {
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.homepage-sidebar .sidebar-section:last-child {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* Spezielle Styling für bestimmte Bereiche */
|
||||
.homepage-sidebar .sidebar-top {
|
||||
border-bottom: 2px solid var(--primary-accent, #00d4ff);
|
||||
}
|
||||
|
||||
.homepage-sidebar .sidebar-bottom {
|
||||
padding-top: 20px;
|
||||
border-top: 2px solid var(--primary-accent, #00d4ff);
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.homepage-sidebar .widget {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.homepage-sidebar .widget:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.homepage-sidebar .widget-title {
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 2px solid var(--primary-accent, #00d4ff);
|
||||
color: var(--primary-accent, #00d4ff);
|
||||
}
|
||||
|
||||
.homepage-sidebar ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.homepage-sidebar ul li {
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.homepage-sidebar ul li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.homepage-sidebar a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.homepage-sidebar a:hover {
|
||||
color: var(--primary-accent, #00d4ff);
|
||||
}
|
||||
|
||||
/* Mobile: Sidebar unter Content */
|
||||
@media (max-width: 768px) {
|
||||
.content-area.with-sidebar.sidebar-right,
|
||||
.content-area.with-sidebar.sidebar-left {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar .homepage-sidebar {
|
||||
order: 3 !important; /* Immer unten auf mobilen Geräten */
|
||||
position: relative;
|
||||
top: 0;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.content-area.with-sidebar .main-content {
|
||||
order: 1 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark Mode Anpassungen */
|
||||
body.dark-mode .homepage-sidebar {
|
||||
background: #1e1e1e;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
body.dark-mode .homepage-sidebar ul li {
|
||||
border-bottom-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* Light Mode Anpassungen */
|
||||
body.light-mode .homepage-sidebar {
|
||||
background: #ffffff;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body.light-mode .homepage-sidebar .sidebar-section {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body.light-mode .homepage-sidebar ul li {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body.light-mode .homepage-sidebar .widget-title {
|
||||
color: var(--primary-accent, #00d4ff);
|
||||
}
|
||||
|
||||
/* Scrollbar Styling für Sidebar */
|
||||
.homepage-sidebar::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.homepage-sidebar::-webkit-scrollbar-track {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.homepage-sidebar::-webkit-scrollbar-thumb {
|
||||
background: var(--primary-accent, #00d4ff);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.homepage-sidebar::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--primary-accent-hover, #00b8e6);
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,19 +7,19 @@
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
|
||||
<header id="masthead" class="site-header">
|
||||
<div class="container">
|
||||
<div class="header-main">
|
||||
<div class="site-branding">
|
||||
<?php
|
||||
// Zeigt das Logo an, wenn eines vorhanden ist.
|
||||
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
|
||||
the_custom_logo();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Zeigt den Titel der Website IMMER an.
|
||||
// Verwendet <h1> auf der Startseite, sonst <p> für bessere SEO.
|
||||
if ( is_front_page() && is_home() ) :
|
||||
?>
|
||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||
@@ -27,41 +27,53 @@
|
||||
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<nav id="site-navigation" class="main-navigation">
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false ) ); ?>
|
||||
|
||||
<!-- NAVIGATION START -->
|
||||
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e('Hauptmenü','minecraft-modern-theme'); ?>">
|
||||
<!-- Mobile Toggle Button -->
|
||||
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
|
||||
<?php
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'menu_class' => 'primary-menu',
|
||||
'fallback_cb' => false,
|
||||
) );
|
||||
?>
|
||||
</nav>
|
||||
<!-- NAVIGATION ENDE -->
|
||||
|
||||
<div class="header-info">
|
||||
<div class="social-links">
|
||||
<?php
|
||||
// Array mit den Social-Media-Plattformen und ihren Font Awesome Klassen
|
||||
$social_icons = array(
|
||||
'discord' => 'fab fa-discord',
|
||||
'youtube' => 'fab fa-youtube',
|
||||
'twitter' => 'fab fa-x-twitter', // Neues Icon für Twitter/X
|
||||
'facebook' => 'fab fa-facebook-f',
|
||||
'instagram' => 'fab fa-instagram',
|
||||
'tiktok' => 'fab fa-tiktok',
|
||||
'twitch' => 'fab fa-twitch',
|
||||
'steam' => 'fab fa-steam',
|
||||
'github' => 'fab fa-github',
|
||||
'linkedin' => 'fab fa-linkedin-in',
|
||||
'pinterest' => 'fab fa-pinterest-p',
|
||||
'reddit' => 'fab fa-reddit-alien',
|
||||
'teamspeak' => 'fab fa-teamspeak',
|
||||
'spotify' => 'fab fa-spotify'
|
||||
);
|
||||
<?php
|
||||
$social_icons = array(
|
||||
'discord' => 'fab fa-discord',
|
||||
'youtube' => 'fab fa-youtube',
|
||||
'twitter' => 'fab fa-x-twitter',
|
||||
'facebook' => 'fab fa-facebook-f',
|
||||
'instagram' => 'fab fa-instagram',
|
||||
'tiktok' => 'fab fa-tiktok',
|
||||
'twitch' => 'fab fa-twitch',
|
||||
'steam' => 'fab fa-steam',
|
||||
'github' => 'fab fa-github',
|
||||
'linkedin' => 'fab fa-linkedin-in',
|
||||
'pinterest' => 'fab fa-pinterest-p',
|
||||
'reddit' => 'fab fa-reddit-alien',
|
||||
'teamspeak' => 'fab fa-teamspeak',
|
||||
'spotify' => 'fab fa-spotify'
|
||||
);
|
||||
|
||||
// Schleife, die alle verfügbaren Icons durchgeht
|
||||
foreach ($social_icons as $key => $class) {
|
||||
// Prüfen, ob für diese Plattform eine URL im Customizer hinterlegt wurde
|
||||
if (get_theme_mod('social_' . $key)) {
|
||||
// Wenn ja, Link und Icon ausgeben
|
||||
echo '<a href="' . esc_url(get_theme_mod('social_' . $key)) . '" target="_blank"><i class="' . esc_attr($class) . '"></i></a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
foreach ( $social_icons as $key => $class ) {
|
||||
if ( get_theme_mod( 'social_' . $key ) ) {
|
||||
echo '<a href="' . esc_url( get_theme_mod( 'social_' . $key ) ) . '" target="_blank" rel="noopener"><i class="' . esc_attr( $class ) . '"></i></a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .header-main -->
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
@@ -1,258 +1,589 @@
|
||||
<?php
|
||||
|
||||
function minecraft_modern_customize_register( $wp_customize ) {
|
||||
|
||||
// =========================================================================
|
||||
// === 1. HEADER-BEREICH ===================================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: Header Slider ---
|
||||
$wp_customize->add_section( 'header_slider', array(
|
||||
'title' => 'Header Slider',
|
||||
'priority' => 20,
|
||||
'description' => 'Konfiguriere den großen Slider auf der Startseite.',
|
||||
) );
|
||||
|
||||
// Checkbox zum Aktivieren des Sliders
|
||||
$wp_customize->add_setting( 'slider_enabled', array(
|
||||
'default' => false,
|
||||
'transport' => 'refresh',
|
||||
'sanitize_callback' => 'wp_validate_boolean',
|
||||
) );
|
||||
$wp_customize->add_control( 'slider_enabled', array(
|
||||
'label' => 'Header Slider aktivieren',
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_enabled',
|
||||
'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// Dynamische Slider-Bilder, Titel und Untertitel
|
||||
for ($i = 1; $i <= 5; $i++) {
|
||||
$wp_customize->add_setting( 'slider_image_' . $i, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Bild', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_image_' . $i,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_title_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_title_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Titel', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_title_' . $i,
|
||||
'type' => 'text',
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_subtitle_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_subtitle_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Untertitel', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_subtitle_' . $i,
|
||||
'type' => 'text',
|
||||
) );
|
||||
}
|
||||
|
||||
// Slider Text- & Stil-Einstellungen
|
||||
$wp_customize->add_setting( 'slider_font_family', array( 'default' => 'Raleway', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_font_family', array(
|
||||
'label' => 'Schriftart', 'section' => 'header_slider', 'settings' => 'slider_font_family', 'type' => 'select',
|
||||
'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ),
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_font_size', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_font_size', array(
|
||||
'label' => 'Schriftgröße', 'section' => 'header_slider', 'settings' => 'slider_font_size', 'type' => 'select',
|
||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß', 'extra-gross' => 'Extra Groß' ),
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_font_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'slider_font_color', array(
|
||||
'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color',
|
||||
) ) );
|
||||
|
||||
// === VERGESSENE EINSTELLUNG WIEDER HINZUGEFÜGT ===
|
||||
$wp_customize->add_setting( 'header_height', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'header_height', array(
|
||||
'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select',
|
||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß' ),
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_hide_arrows', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'slider_hide_arrows', array(
|
||||
'label' => 'Pfeile ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_arrows', 'type' => 'checkbox',
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_hide_pagination', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'slider_hide_pagination', array(
|
||||
'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
|
||||
// --- Sektion: Startseiten-Hero (Fallback) ---
|
||||
$wp_customize->add_section( 'hero_section', array(
|
||||
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
||||
'priority' => 21,
|
||||
'description' => 'Diese Inhalte werden angezeigt, wenn der Slider ausgeschaltet ist.',
|
||||
) );
|
||||
$wp_customize->add_setting( 'hero_title', array( 'default' => 'Willkommen auf unserem Server', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_title', array( 'label' => 'Haupttitel', 'section' => 'hero_section', 'settings' => 'hero_title', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_subtitle', array( 'default' => 'Trete einer Community voller Abenteuer bei.', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_subtitle', array( 'label' => 'Untertitel', 'section' => 'hero_section', 'settings' => 'hero_subtitle', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_bg_image', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array(
|
||||
'label' => 'Hintergrundbild', 'section' => 'hero_section', 'settings' => 'hero_bg_image',
|
||||
) ) );
|
||||
$wp_customize->add_setting( 'hero_button_1_text', array( 'default' => 'Zum Forum', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_button_1_text', array( 'label' => 'Button 1 Text', 'section' => 'hero_section', 'settings' => 'hero_button_1_text', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_button_1_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'hero_button_1_url', array( 'label' => 'Button 1 URL', 'section' => 'hero_section', 'settings' => 'hero_button_1_url', 'type' => 'url' ) );
|
||||
$wp_customize->add_setting( 'hero_button_2_text', array( 'default' => 'Zum Teamspeak', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_button_2_text', array( 'label' => 'Button 2 Text', 'section' => 'hero_section', 'settings' => 'hero_button_2_text', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'hero_button_2_url', array( 'label' => 'Button 2 URL', 'section' => 'hero_section', 'settings' => 'hero_button_2_url', 'type' => 'url' ) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: Farben & Darstellung ---
|
||||
$wp_customize->add_section( 'theme_appearance_settings', array(
|
||||
'title' => 'Farben & Darstellung',
|
||||
'priority' => 30,
|
||||
) );
|
||||
|
||||
// Akzentfarbe
|
||||
$wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array(
|
||||
'label' => 'Akzentfarbe', 'section' => 'theme_appearance_settings', 'settings' => 'primary_accent_color',
|
||||
) ) );
|
||||
|
||||
// Hintergrundfarbe
|
||||
$wp_customize->add_setting( 'background_color', array(
|
||||
'default' => '#ffffff',
|
||||
'sanitize_callback' => 'sanitize_hex_color',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
|
||||
'label' => 'Hintergrundfarbe',
|
||||
'section' => 'theme_appearance_settings',
|
||||
'settings' => 'background_color',
|
||||
) ) );
|
||||
|
||||
// Dark / Light Mode
|
||||
$wp_customize->add_setting( 'default_theme_mode', array( 'default' => 'dark', 'sanitize_callback' => 'sanitize_key' ) );
|
||||
$wp_customize->add_control( 'default_theme_mode', array(
|
||||
'label' => 'Standard-Theme-Modus', 'section' => 'theme_appearance_settings', 'type' => 'radio',
|
||||
'choices' => array( 'dark' => 'Dark Mode (Standard)', 'light' => 'Light Mode' ),
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 3. SOCIAL MEDIA =====================================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
||||
$social_platforms = array( 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify' );
|
||||
foreach ($social_platforms as $key => $label) {
|
||||
$wp_customize->add_setting( 'social_' . $key, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'social_' . $key, array(
|
||||
'label' => $label . ' URL', 'section' => 'social_links', 'settings' => 'social_' . $key, 'type' => 'url',
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 4. FOOTER-BEREICH ==================================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
||||
|
||||
// Copyright-Text
|
||||
$wp_customize->add_setting( 'footer_copyright', array( 'default' => '© ' . date('Y') . ' ' . get_bloginfo('name'), 'sanitize_callback' => 'wp_kses_post' ) );
|
||||
$wp_customize->add_control( 'footer_copyright', array(
|
||||
'label' => 'Copyright-Text', 'section' => 'footer_settings', 'settings' => 'footer_copyright', 'type' => 'textarea',
|
||||
) );
|
||||
|
||||
// Impressum & Datenschutz Links
|
||||
$wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'footer_impressum_url', array(
|
||||
'label' => 'URL für Impressum', 'section' => 'footer_settings', 'settings' => 'footer_impressum_url', 'type' => 'url',
|
||||
) );
|
||||
$wp_customize->add_setting( 'footer_datenschutz_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'footer_datenschutz_url', array(
|
||||
'label' => 'URL für Datenschutz', 'section' => 'footer_settings', 'settings' => 'footer_datenschutz_url', 'type' => 'url',
|
||||
) );
|
||||
|
||||
// Footer-Credit
|
||||
$wp_customize->add_setting( 'show_footer_credit', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'show_footer_credit', array(
|
||||
'label' => 'Footer-Credit ("Minecraft Theme Erstellt von...") anzeigen', 'section' => 'footer_settings', 'settings' => 'show_footer_credit', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 5. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: FAQ Einstellungen ---
|
||||
$wp_customize->add_section( 'faq_settings', array( 'title' => 'FAQ Einstellungen', 'priority' => 60 ) );
|
||||
$wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'faq_enabled', array(
|
||||
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
}
|
||||
add_action( 'customize_register', 'minecraft_modern_customize_register' );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === DYNAMISCHES CSS =====================================================
|
||||
// =========================================================================
|
||||
|
||||
// Diese Funktion bleibt unverändert, da sie bereits gut strukturiert ist.
|
||||
function minecraft_modern_dynamic_css_output() {
|
||||
$accent_color = get_theme_mod( 'primary_accent_color', '#00d4ff' );
|
||||
$slider_font = get_theme_mod( 'slider_font_family', 'Raleway' );
|
||||
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
||||
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
|
||||
$header_height_setting = get_theme_mod( 'header_height', 'mittel' ); // Diese Einstellung wird hier verwendet!
|
||||
|
||||
// Header-Höhe umwandeln
|
||||
$header_height_value = '300px';
|
||||
if ( $header_height_setting === 'klein' ) {
|
||||
$header_height_value = '200px';
|
||||
} elseif ( $header_height_setting === 'gross' ) {
|
||||
$header_height_value = '400px';
|
||||
}
|
||||
|
||||
// Schriftgrößen umwandeln
|
||||
$font_sizes = array(
|
||||
'klein' => array( 'title' => '2.5rem', 'subtitle' => '1.2rem' ),
|
||||
'mittel' => array( 'title' => '3.5rem', 'subtitle' => '1.4rem' ),
|
||||
'gross' => array( 'title' => '4.5rem', 'subtitle' => '1.6rem' ),
|
||||
'extra-gross' => array( 'title' => '5.5rem', 'subtitle' => '1.8rem' ),
|
||||
);
|
||||
$chosen_sizes = isset( $font_sizes[$slider_size_setting] ) ? $font_sizes[$slider_size_setting] : $font_sizes['mittel'];
|
||||
|
||||
$fonts_to_load = array($slider_font);
|
||||
$fonts_url = 'https://fonts.googleapis.com/css2?family=' . implode( ':wght@400;600;700&family=', $fonts_to_load ) . '&display=swap';
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo esc_url($fonts_url); ?>">
|
||||
<style type="text/css">
|
||||
:root {
|
||||
--primary-accent: <?php echo esc_attr($accent_color); ?>;
|
||||
--header-height: <?php echo esc_attr($header_height_value); ?>;
|
||||
}
|
||||
.slider-title, .slider-subtitle, .hero-title, .hero-subtitle, .hero-button-1, .hero-button-2 {
|
||||
font-family: '<?php echo esc_attr($slider_font); ?>', sans-serif;
|
||||
color: <?php echo esc_attr($slider_color); ?>;
|
||||
}
|
||||
.slider-title, .hero-title {
|
||||
font-size: <?php echo esc_attr($chosen_sizes['title']); ?>;
|
||||
}
|
||||
.slider-subtitle, .hero-subtitle {
|
||||
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
||||
<?php
|
||||
/**
|
||||
* Minecraft Modern Theme - Customizer Settings
|
||||
*
|
||||
* Enthält Einstellungen für:
|
||||
* - Header Slider & Hero
|
||||
* - Theme Presets (Nether, End, Classic)
|
||||
* - Farben & Darstellung
|
||||
* - Social Media
|
||||
* - Footer
|
||||
* - Login
|
||||
* - Sidebar
|
||||
* - Import/Export
|
||||
*/
|
||||
|
||||
function minecraft_modern_customize_register( $wp_customize ) {
|
||||
|
||||
// =========================================================================
|
||||
// === 1. HEADER-BEREICH ===================================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: Header Slider ---
|
||||
$wp_customize->add_section( 'header_slider', array(
|
||||
'title' => 'Header Slider',
|
||||
'priority' => 20,
|
||||
'description' => 'Konfiguriere den großen Slider auf der Startseite.',
|
||||
) );
|
||||
|
||||
// Checkbox zum Aktivieren des Sliders
|
||||
$wp_customize->add_setting( 'slider_enabled', array(
|
||||
'default' => false,
|
||||
'transport' => 'refresh',
|
||||
'sanitize_callback' => 'wp_validate_boolean',
|
||||
) );
|
||||
$wp_customize->add_control( 'slider_enabled', array(
|
||||
'label' => 'Header Slider aktivieren',
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_enabled',
|
||||
'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// Dynamische Slider-Bilder, Titel und Untertitel
|
||||
for ($i = 1; $i <= 5; $i++) {
|
||||
$wp_customize->add_setting( 'slider_image_' . $i, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Bild', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_image_' . $i,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_title_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_title_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Titel', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_title_' . $i,
|
||||
'type' => 'text',
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_subtitle_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_subtitle_' . $i, array(
|
||||
'label' => sprintf( 'Banner %d - Untertitel', $i ),
|
||||
'section' => 'header_slider',
|
||||
'settings' => 'slider_subtitle_' . $i,
|
||||
'type' => 'text',
|
||||
) );
|
||||
}
|
||||
|
||||
// Slider Text- & Stil-Einstellungen
|
||||
$wp_customize->add_setting( 'slider_font_family', array( 'default' => 'Raleway', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_font_family', array(
|
||||
'label' => 'Schriftart', 'section' => 'header_slider', 'settings' => 'slider_font_family', 'type' => 'select',
|
||||
'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ),
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_font_size', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'slider_font_size', array(
|
||||
'label' => 'Schriftgröße', 'section' => 'header_slider', 'settings' => 'slider_font_size', 'type' => 'select',
|
||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß', 'extra-gross' => 'Extra Groß' ),
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_font_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'slider_font_color', array(
|
||||
'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color',
|
||||
) ) );
|
||||
|
||||
// Header-Höhe
|
||||
$wp_customize->add_setting( 'header_height', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'header_height', array(
|
||||
'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select',
|
||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß' ),
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'slider_hide_arrows', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'slider_hide_arrows', array(
|
||||
'label' => 'Pfeile ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_arrows', 'type' => 'checkbox',
|
||||
) );
|
||||
$wp_customize->add_setting( 'slider_hide_pagination', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'slider_hide_pagination', array(
|
||||
'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// --- Sektion: Startseiten-Hero (Fallback) ---
|
||||
$wp_customize->add_section( 'hero_section', array(
|
||||
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
||||
'priority' => 21,
|
||||
'description' => 'Diese Inhalte werden angezeigt, wenn der Slider ausgeschaltet ist.',
|
||||
) );
|
||||
$wp_customize->add_setting( 'hero_title', array( 'default' => 'Willkommen auf unserem Server', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_title', array( 'label' => 'Haupttitel', 'section' => 'hero_section', 'settings' => 'hero_title', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_subtitle', array( 'default' => 'Trete einer Community voller Abenteuer bei.', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_subtitle', array( 'label' => 'Untertitel', 'section' => 'hero_section', 'settings' => 'hero_subtitle', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_bg_image', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array(
|
||||
'label' => 'Hintergrundbild', 'section' => 'hero_section', 'settings' => 'hero_bg_image',
|
||||
) ) );
|
||||
$wp_customize->add_setting( 'hero_button_1_text', array( 'default' => 'Zum Forum', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_button_1_text', array( 'label' => 'Button 1 Text', 'section' => 'hero_section', 'settings' => 'hero_button_1_text', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_button_1_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'hero_button_1_url', array( 'label' => 'Button 1 URL', 'section' => 'hero_section', 'settings' => 'hero_button_1_url', 'type' => 'url' ) );
|
||||
$wp_customize->add_setting( 'hero_button_2_text', array( 'default' => 'Zum Teamspeak', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||
$wp_customize->add_control( 'hero_button_2_text', array( 'label' => 'Button 2 Text', 'section' => 'hero_section', 'settings' => 'hero_button_2_text', 'type' => 'text' ) );
|
||||
$wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'hero_button_2_url', array( 'label' => 'Button 2 URL', 'section' => 'hero_section', 'settings' => 'hero_button_2_url', 'type' => 'url' ) );
|
||||
|
||||
// --- Checkbox: Seitentitel auf Startseite verstecken ---
|
||||
$wp_customize->add_setting( 'show_home_title', array(
|
||||
'default' => false,
|
||||
'sanitize_callback' => 'wp_validate_boolean',
|
||||
) );
|
||||
$wp_customize->add_control( 'show_home_title', array(
|
||||
'label' => 'Seitentitel "Home" anzeigen',
|
||||
'description' => 'Aktiviere diese Option, wenn der Titel "Home" über dem Slider/Inhalt angezeigt werden soll.',
|
||||
'section' => 'hero_section',
|
||||
'settings' => 'show_home_title',
|
||||
'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: Farben & Darstellung ---
|
||||
$wp_customize->add_section( 'theme_appearance_settings', array(
|
||||
'title' => 'Farben & Darstellung',
|
||||
'priority' => 30,
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === NEU: THEME PRESETS (VOREINSTELLUNGEN) ==============================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_setting( 'theme_color_preset', array(
|
||||
'default' => 'classic',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( 'theme_color_preset', array(
|
||||
'label' => 'Theme Preset (Farbschema)',
|
||||
'description' => 'Wähle ein voreingestelltes Farbschema (z. B. für Nether oder End Dimension).',
|
||||
'section' => 'theme_appearance_settings',
|
||||
'settings' => 'theme_color_preset',
|
||||
'type' => 'select',
|
||||
'priority' => 1, // Zeig es ganz oben in dieser Sektion an
|
||||
'choices' => array(
|
||||
'classic' => 'Classic Minecraft (Diamant-Blau)',
|
||||
'nether' => 'Nether (Lava-Rot)',
|
||||
'end' => 'The End (Ender-Purpur)',
|
||||
),
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === ENDE THEME PRESETS ==================================================
|
||||
// =========================================================================
|
||||
|
||||
// Akzentfarbe
|
||||
$wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array(
|
||||
'label' => 'Akzentfarbe', 'section' => 'theme_appearance_settings', 'settings' => 'primary_accent_color',
|
||||
) ) );
|
||||
|
||||
// Hintergrundfarbe
|
||||
$wp_customize->add_setting( 'background_color', array(
|
||||
'default' => '#ffffff',
|
||||
'sanitize_callback' => 'sanitize_hex_color',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
|
||||
'label' => 'Hintergrundfarbe',
|
||||
'section' => 'theme_appearance_settings',
|
||||
'settings' => 'background_color',
|
||||
) ) );
|
||||
|
||||
// Dark / Light Mode
|
||||
$wp_customize->add_setting( 'default_theme_mode', array( 'default' => 'dark', 'sanitize_callback' => 'sanitize_key' ) );
|
||||
$wp_customize->add_control( 'default_theme_mode', array(
|
||||
'label' => 'Standard-Theme-Modus', 'section' => 'theme_appearance_settings', 'type' => 'radio',
|
||||
'choices' => array( 'dark' => 'Dark Mode (Standard)', 'light' => 'Light Mode' ),
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 3. SIDEBAR EINSTELLUNGEN ============================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'sidebar_settings', array(
|
||||
'title' => 'Sidebar Einstellungen',
|
||||
'priority' => 35,
|
||||
'description' => 'Konfiguriere die Sidebar auf der Startseite.',
|
||||
) );
|
||||
|
||||
// Sidebar aktivieren
|
||||
$wp_customize->add_setting( 'homepage_sidebar_enabled', array(
|
||||
'default' => false,
|
||||
'sanitize_callback' => 'wp_validate_boolean',
|
||||
) );
|
||||
$wp_customize->add_control( 'homepage_sidebar_enabled', array(
|
||||
'label' => 'Sidebar auf Startseite aktivieren',
|
||||
'description' => 'Zeigt eine Sidebar neben dem Hauptinhalt an.',
|
||||
'section' => 'sidebar_settings',
|
||||
'settings' => 'homepage_sidebar_enabled',
|
||||
'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// Sidebar Position
|
||||
$wp_customize->add_setting( 'homepage_sidebar_position', array(
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'sanitize_key',
|
||||
) );
|
||||
$wp_customize->add_control( 'homepage_sidebar_position', array(
|
||||
'label' => 'Sidebar Position',
|
||||
'section' => 'sidebar_settings',
|
||||
'settings' => 'homepage_sidebar_position',
|
||||
'type' => 'select',
|
||||
'choices' => array(
|
||||
'left' => 'Links',
|
||||
'right' => 'Rechts',
|
||||
),
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 4. SOCIAL MEDIA =====================================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
||||
$social_platforms = array( 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify' );
|
||||
foreach ($social_platforms as $key => $label) {
|
||||
$wp_customize->add_setting( 'social_' . $key, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'social_' . $key, array(
|
||||
'label' => $label . ' URL', 'section' => 'social_links', 'settings' => 'social_' . $key, 'type' => 'url',
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 5. FOOTER-BEREICH ==================================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
||||
|
||||
// Copyright-Text
|
||||
$wp_customize->add_setting( 'footer_copyright', array( 'default' => '© ' . date('Y') . ' ' . get_bloginfo('name'), 'sanitize_callback' => 'wp_kses_post' ) );
|
||||
$wp_customize->add_control( 'footer_copyright', array(
|
||||
'label' => 'Copyright-Text', 'section' => 'footer_settings', 'settings' => 'footer_copyright', 'type' => 'textarea',
|
||||
) );
|
||||
|
||||
// Impressum & Datenschutz Links
|
||||
$wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'footer_impressum_url', array(
|
||||
'label' => 'URL für Impressum', 'section' => 'footer_settings', 'settings' => 'footer_impressum_url', 'type' => 'url',
|
||||
) );
|
||||
$wp_customize->add_setting( 'footer_datenschutz_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||
$wp_customize->add_control( 'footer_datenschutz_url', array(
|
||||
'label' => 'URL für Datenschutz', 'section' => 'footer_settings', 'settings' => 'footer_datenschutz_url', 'type' => 'url',
|
||||
) );
|
||||
|
||||
// Footer-Credit
|
||||
$wp_customize->add_setting( 'show_footer_credit', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'show_footer_credit', array(
|
||||
'label' => 'Footer-Credit ("Minecraft Theme Erstellt von...") anzeigen', 'section' => 'footer_settings', 'settings' => 'show_footer_credit', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === 6. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
||||
// =========================================================================
|
||||
|
||||
// --- Sektion: FAQ Einstellungen ---
|
||||
$wp_customize->add_section( 'faq_settings', array( 'title' => 'FAQ Einstellungen', 'priority' => 60 ) );
|
||||
$wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'faq_enabled', array(
|
||||
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// --- Sektion: Team Einstellungen ---
|
||||
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) );
|
||||
$wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||
$wp_customize->add_control( 'team_enabled', array(
|
||||
'label' => 'Team Showcase aktivieren', 'section' => 'team_settings', 'settings' => 'team_enabled', 'type' => 'checkbox',
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === 7. LOGIN-BEREICH ====================================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'login_settings', array(
|
||||
'title' => 'Login-Einstellungen',
|
||||
'priority' => 70,
|
||||
'description' => 'Passe das Aussehen der wp-admin Login-Seite an.',
|
||||
) );
|
||||
|
||||
// Login-Hintergrundbild
|
||||
$wp_customize->add_setting( 'login_background_image', array(
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_background_image', array(
|
||||
'label' => 'Login-Hintergrundbild',
|
||||
'section' => 'login_settings',
|
||||
'settings' => 'login_background_image',
|
||||
) ) );
|
||||
|
||||
// Login-Logo
|
||||
$wp_customize->add_setting( 'login_logo', array(
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_logo', array(
|
||||
'label' => 'Login-Logo (ersetzt das WordPress-Logo)',
|
||||
'section' => 'login_settings',
|
||||
'settings' => 'login_logo',
|
||||
) ) );
|
||||
|
||||
// Multi-Avatar UUIDs
|
||||
for ($i = 1; $i <= 5; $i++) {
|
||||
$wp_customize->add_setting( 'login_avatar_uuid_' . $i, array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( 'login_avatar_uuid_' . $i, array(
|
||||
'label' => sprintf( 'Avatar %d UUID', $i ),
|
||||
'description' => sprintf( 'Gib die UUID für den %d. Avatar an. (Leer lassen, um zu deaktivieren)', $i ),
|
||||
'section' => 'login_settings',
|
||||
'settings' => 'login_avatar_uuid_' . $i,
|
||||
'type' => 'text',
|
||||
) );
|
||||
}
|
||||
|
||||
// Slider-Geschwindigkeit
|
||||
$wp_customize->add_setting( 'login_avatar_slider_speed', array(
|
||||
'default' => 4,
|
||||
'sanitize_callback' => 'absint',
|
||||
'transport' => 'refresh',
|
||||
) );
|
||||
$wp_customize->add_control( 'login_avatar_slider_speed', array(
|
||||
'label' => 'Avatar-Wechsel (in Sekunden)',
|
||||
'description' => 'Wie viele Sekunden soll ein Avatar angezeigt werden?',
|
||||
'section' => 'login_settings',
|
||||
'settings' => 'login_avatar_slider_speed',
|
||||
'type' => 'number',
|
||||
'input_attrs' => array( 'min' => 2, 'max' => 10, 'step' => 1 ),
|
||||
) );
|
||||
|
||||
// =========================================================================
|
||||
// === 8. EXPORT / IMPORT SECTION =========================================
|
||||
// =========================================================================
|
||||
|
||||
$wp_customize->add_section( 'theme_mods_import_export', array(
|
||||
'title' => __( 'Einstellungen sichern', 'minecraft-modern-theme' ),
|
||||
'priority' => 999,
|
||||
'description' => '',
|
||||
) );
|
||||
|
||||
// Füge ein Custom Control mit HTML hinzu
|
||||
$wp_customize->add_setting( 'import_export_placeholder', array(
|
||||
'sanitize_callback' => 'sanitize_text_field',
|
||||
) );
|
||||
|
||||
// Custom Control Class für Export/Import
|
||||
class Import_Export_Control extends WP_Customize_Control {
|
||||
public $type = 'import_export';
|
||||
|
||||
public function render_content() {
|
||||
$export_url = admin_url('admin-post.php?action=export_theme_settings');
|
||||
$nonce = wp_create_nonce('theme-import-nonce');
|
||||
?>
|
||||
<div class="import-export-wrapper" style="margin-top: 15px;">
|
||||
<p class="description" style="margin-bottom: 20px;">
|
||||
<strong>Hinweis:</strong> Hier kannst du alle deine Theme-Einstellungen sichern und wiederherstellen.
|
||||
</p>
|
||||
|
||||
<a href="<?php echo esc_url($export_url); ?>" class="button button-primary button-hero" id="export-settings-btn" style="display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;">
|
||||
<span class="dashicons dashicons-download" style="margin-top:3px;"></span> Einstellungen Exportieren
|
||||
</a>
|
||||
|
||||
<div style="border-top: 2px solid #ddd; padding-top: 20px; margin-top: 20px;">
|
||||
<label style="display:block; margin-bottom:10px; font-weight:bold;">
|
||||
Backup wiederherstellen:
|
||||
</label>
|
||||
<input type="file" id="import-settings-file" accept=".json" style="width:100%; margin-bottom:10px;">
|
||||
<button type="button" class="button button-secondary" id="import-settings-btn" disabled style="display: inline-flex; align-items: center; gap: 8px;">
|
||||
<span class="dashicons dashicons-upload" style="margin-top:3px;"></span> Einstellungen Importieren
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="description" style="margin-top:15px; padding: 10px; background: #fff3cd; border-left: 4px solid #ffc107;">
|
||||
<strong>⚠️ Warnung:</strong> Beim Import werden alle aktuellen Einstellungen überschrieben!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
var ajaxUrl = '<?php echo admin_url('admin-ajax.php'); ?>';
|
||||
var nonce = '<?php echo $nonce; ?>';
|
||||
|
||||
$('#import-settings-file').on('change', function() {
|
||||
$('#import-settings-btn').prop('disabled', $(this).val() === '');
|
||||
});
|
||||
|
||||
$('#import-settings-btn').on('click', function() {
|
||||
var fileInput = $('#import-settings-file')[0];
|
||||
|
||||
if (fileInput.files.length === 0) {
|
||||
alert('Bitte wähle eine JSON-Datei aus.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirm('WARNUNG: Alle aktuellen Einstellungen werden überschrieben. Bist du sicher?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('import_file', fileInput.files[0]);
|
||||
formData.append('action', 'import_theme_settings');
|
||||
formData.append('nonce', nonce);
|
||||
|
||||
var $btn = $(this);
|
||||
var originalText = $btn.html();
|
||||
$btn.prop('disabled', true).html('<span class="dashicons dashicons-update" style="margin-top:3px; animation: rotation 1s infinite linear;"></span> Importiere...');
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
alert('✅ ' + response.data);
|
||||
location.reload();
|
||||
} else {
|
||||
alert('❌ Fehler: ' + response.data);
|
||||
$btn.prop('disabled', false).html(originalText);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
alert('❌ Ein technischer Fehler ist aufgetreten.');
|
||||
$btn.prop('disabled', false).html(originalText);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@keyframes rotation {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
$wp_customize->add_control( new Import_Export_Control( $wp_customize, 'import_export_placeholder', array(
|
||||
'section' => 'theme_mods_import_export',
|
||||
) ) );
|
||||
}
|
||||
add_action( 'customize_register', 'minecraft_modern_customize_register' );
|
||||
|
||||
|
||||
// =========================================================================
|
||||
// === DYNAMISCHES CSS =====================================================
|
||||
// =========================================================================
|
||||
|
||||
function minecraft_modern_dynamic_css_output() {
|
||||
$accent_color = get_theme_mod( 'primary_accent_color', '#00d4ff' );
|
||||
$slider_font = get_theme_mod( 'slider_font_family', 'Raleway' );
|
||||
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
||||
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
|
||||
$header_height_setting = get_theme_mod( 'header_height', 'mittel' );
|
||||
|
||||
// Header-Höhe umwandeln
|
||||
$header_height_value = '300px';
|
||||
if ( $header_height_setting === 'klein' ) {
|
||||
$header_height_value = '200px';
|
||||
} elseif ( $header_height_setting === 'gross' ) {
|
||||
$header_height_value = '400px';
|
||||
}
|
||||
|
||||
// Schriftgrößen umwandeln
|
||||
$font_sizes = array(
|
||||
'klein' => array( 'title' => '2.5rem', 'subtitle' => '1.2rem' ),
|
||||
'mittel' => array( 'title' => '3.5rem', 'subtitle' => '1.4rem' ),
|
||||
'gross' => array( 'title' => '4.5rem', 'subtitle' => '1.6rem' ),
|
||||
'extra-gross' => array( 'title' => '5.5rem', 'subtitle' => '1.8rem' ),
|
||||
);
|
||||
$chosen_sizes = isset( $font_sizes[$slider_size_setting] ) ? $font_sizes[$slider_size_setting] : $font_sizes['mittel'];
|
||||
|
||||
$fonts_to_load = array($slider_font);
|
||||
$fonts_url = 'https://fonts.googleapis.com/css2?family=' . implode( ':wght@400;600;700&family=', $fonts_to_load ) . '&display=swap';
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo esc_url($fonts_url); ?>">
|
||||
<style type="text/css">
|
||||
:root {
|
||||
--primary-accent: <?php echo esc_attr($accent_color); ?>;
|
||||
--header-height: <?php echo esc_attr($header_height_value); ?>;
|
||||
}
|
||||
.slider-title, .slider-subtitle, .hero-title, .hero-subtitle, .hero-button-1, .hero-button-2 {
|
||||
font-family: '<?php echo esc_attr($slider_font); ?>', sans-serif;
|
||||
color: <?php echo esc_attr($slider_color); ?>;
|
||||
}
|
||||
.slider-title, .hero-title {
|
||||
font-size: <?php echo esc_attr($chosen_sizes['title']); ?>;
|
||||
}
|
||||
.slider-subtitle, .hero-subtitle {
|
||||
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
||||
}
|
||||
|
||||
/* Trennlinie unter dem Header */
|
||||
.site-header {
|
||||
border-bottom: 4px solid var(--primary-accent);
|
||||
}
|
||||
|
||||
/* Trennlinie unter dem Slider */
|
||||
.hero-slider {
|
||||
border-bottom: 4px solid var(--primary-accent);
|
||||
}
|
||||
|
||||
/* Trennlinie am oberen Rand des Footers */
|
||||
.site-footer {
|
||||
border-top: 4px solid var(--primary-accent);
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
||||
|
||||
// =========================================================================
|
||||
// === THEME PRESET LOGIC (JAVASCRIPT) =====================================
|
||||
// =========================================================================
|
||||
|
||||
/**
|
||||
* Verbindet das Preset-Dropdown mit der Akzentfarbe-Einstellung.
|
||||
* Sobald ein Preset gewählt wird, wird die Farbe im Customizer aktualisiert.
|
||||
*/
|
||||
function minecraft_preset_customize_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
// Definiere die Farben für die Presets
|
||||
var presetColors = {
|
||||
'classic': '#00d4ff', // Diamant Blau
|
||||
'nether': '#ff3333', // Lava Rot
|
||||
'end': '#aa00ff' // Ender Purpur
|
||||
};
|
||||
|
||||
// Warten bis der Customizer bereit ist
|
||||
wp.customize.bind('ready', function() {
|
||||
|
||||
// Listener für das Preset-Dropdown
|
||||
wp.customize('theme_color_preset', function(setting) {
|
||||
setting.bind(function(to) {
|
||||
// Wenn eine Farbe für das gewählte Preset existiert...
|
||||
if (presetColors[to]) {
|
||||
// ...setze die Akzentfarbe auf diesen Wert.
|
||||
// Das aktualisiert auch den Color Picker und die Live-Vorschau.
|
||||
wp.customize('primary_accent_color').set(presetColors[to]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action('customize_controls_print_footer_scripts', 'minecraft_preset_customize_js');
|
||||
160
Minecraft-Modern-Theme/inc/theme-updater.php
Normal file
160
Minecraft-Modern-Theme/inc/theme-updater.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// === THEME VERSION AUTOMATISCH AUS style.css LADEN (PARENT THEME PRIORITÄT) ===
|
||||
function minecraft_modern_get_theme_version() {
|
||||
// Holt das aktuell aktive Theme (child oder parent)
|
||||
$theme = wp_get_theme();
|
||||
|
||||
// Wenn ein Child-Theme aktiv ist und ein Parent vorhanden ist, nutze die Parent-Version
|
||||
$parent = $theme->parent();
|
||||
if ( $parent && $parent->exists() ) {
|
||||
$parent_version = $parent->get( 'Version' );
|
||||
if ( ! empty( $parent_version ) ) {
|
||||
return $parent_version;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: Version des aktuell aktiven Themes (wenn kein Parent existiert oder Parent keine Version hat)
|
||||
return $theme->get( 'Version' );
|
||||
}
|
||||
|
||||
// === THEME UPDATE NOTIFICATION SYSTEM ===
|
||||
|
||||
// Funktion zum Leeren des Caches (wenn man auf "Update prüfen" klickt)
|
||||
function minecraft_modern_clear_cache() {
|
||||
if ( isset( $_GET['mm_clear_cache'] ) && current_user_can( 'manage_options' ) ) {
|
||||
check_admin_referer( 'mm_clear_cache_action' );
|
||||
delete_transient( 'minecraft_modern_latest_release' );
|
||||
wp_redirect( admin_url( 'index.php' ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
add_action( 'admin_init', 'minecraft_modern_clear_cache' );
|
||||
|
||||
// Funktion zum Abrufen der neuesten Release-Informationen
|
||||
function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
|
||||
$transient_key = 'minecraft_modern_latest_release';
|
||||
|
||||
// Wenn erzwungen wird (oder Cache leer), frische Daten holen
|
||||
if ( $force_refresh ) {
|
||||
delete_transient( $transient_key );
|
||||
}
|
||||
|
||||
$release_info = get_transient( $transient_key );
|
||||
|
||||
if ( false === $release_info ) {
|
||||
// Timeout auf 10 Sekunden erhöht für langsame Verbindungen
|
||||
$response = wp_remote_get(
|
||||
'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest',
|
||||
array( 'timeout' => 10 )
|
||||
);
|
||||
|
||||
if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) {
|
||||
$body = wp_remote_retrieve_body( $response );
|
||||
$release_data = json_decode( $body, true );
|
||||
|
||||
if ( $release_data && isset( $release_data['tag_name'] ) ) {
|
||||
// Tag bereinigen (falls 'v' davor steht, z.B. v1.6 -> 1.6)
|
||||
$tag_name = $release_data['tag_name'];
|
||||
if ( strpos( $tag_name, 'v' ) === 0 ) {
|
||||
$tag_name = ltrim( $tag_name, 'v' );
|
||||
}
|
||||
|
||||
$release_info = array(
|
||||
'version' => $tag_name,
|
||||
'download_url' => $release_data['zipball_url'],
|
||||
'release_notes' => isset( $release_data['body'] ) ? $release_data['body'] : '',
|
||||
'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : ''
|
||||
);
|
||||
|
||||
// Cache für 6 Stunden
|
||||
set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS );
|
||||
} else {
|
||||
// Fehlerhafte Daten leer cachen
|
||||
set_transient( $transient_key, array(), HOUR_IN_SECONDS );
|
||||
}
|
||||
} else {
|
||||
// Fehler beim Abrufen
|
||||
set_transient( $transient_key, array(), HOUR_IN_SECONDS );
|
||||
}
|
||||
}
|
||||
|
||||
return $release_info;
|
||||
}
|
||||
|
||||
// === BENACHRICHTIGUNG IM ADMIN-BEREICH ===
|
||||
function minecraft_modern_show_update_notification() {
|
||||
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$current_version = minecraft_modern_get_theme_version();
|
||||
$latest_release = minecraft_modern_get_latest_release_info();
|
||||
|
||||
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
||||
?>
|
||||
<div class="notice notice-warning is-dismissible">
|
||||
<h3><?php _e( 'Minecraft Modern Theme Update Available', 'minecraft-modern-theme' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
__( 'You are using version %1$s of the Minecraft Modern Theme. Version %2$s is now available.', 'minecraft-modern-theme' ),
|
||||
'<strong>' . esc_html( $current_version ) . '</strong>',
|
||||
'<strong>' . esc_html( $latest_release['version'] ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( $latest_release['download_url'] ); ?>" class="button button-primary" target="_blank">
|
||||
<?php _e( 'Download Latest Version', 'minecraft-modern-theme' ); ?>
|
||||
</a>
|
||||
<a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" class="button" target="_blank">
|
||||
<?php _e( 'View Release Notes', 'minecraft-modern-theme' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
add_action( 'admin_notices', 'minecraft_modern_show_update_notification' );
|
||||
|
||||
// === DASHBOARD WIDGET ===
|
||||
function minecraft_modern_add_dashboard_widget() {
|
||||
wp_add_dashboard_widget(
|
||||
'minecraft_modern_update_widget',
|
||||
'Minecraft Modern Theme Status',
|
||||
'minecraft_modern_update_widget_function'
|
||||
);
|
||||
}
|
||||
add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' );
|
||||
|
||||
function minecraft_modern_update_widget_function() {
|
||||
$current_version = minecraft_modern_get_theme_version();
|
||||
$latest_release = minecraft_modern_get_latest_release_info();
|
||||
|
||||
echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>';
|
||||
|
||||
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) ) {
|
||||
echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>';
|
||||
|
||||
if ( version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</span></p>';
|
||||
echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>';
|
||||
} else {
|
||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>';
|
||||
}
|
||||
} else {
|
||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>';
|
||||
}
|
||||
|
||||
// Link für "Jetzt prüfen"
|
||||
$refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' );
|
||||
echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>';
|
||||
|
||||
echo '<p><a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" target="_blank">' . __( 'View All Releases', 'minecraft-modern-theme' ) . '</a></p>';
|
||||
}
|
||||
84
Minecraft-Modern-Theme/js/announcement.js
Normal file
84
Minecraft-Modern-Theme/js/announcement.js
Normal file
@@ -0,0 +1,84 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const bar = document.getElementById("mm-announcement");
|
||||
if (!bar) return;
|
||||
|
||||
// --- 1. Positionierung ---
|
||||
const position = bar.dataset.position || 'below-header';
|
||||
|
||||
if (position === "top") {
|
||||
document.body.insertAdjacentElement('afterbegin', bar);
|
||||
}
|
||||
else if (position === "below-slider") {
|
||||
const anchor = document.getElementById("mm-announcement-anchor");
|
||||
if (anchor) {
|
||||
anchor.replaceWith(bar);
|
||||
} else {
|
||||
const header = document.getElementById("masthead");
|
||||
if (header) header.insertAdjacentElement('afterend', bar);
|
||||
}
|
||||
}
|
||||
else if (position === "below-header") {
|
||||
const header = document.getElementById("masthead");
|
||||
if (header) header.insertAdjacentElement('afterend', bar);
|
||||
}
|
||||
else {
|
||||
const header = document.getElementById("masthead");
|
||||
if (header) header.insertAdjacentElement('afterend', bar);
|
||||
}
|
||||
|
||||
const closeBtn = bar.querySelector(".mm-announcement-close");
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener("click", function () {
|
||||
bar.style.display = "none";
|
||||
});
|
||||
}
|
||||
|
||||
// --- 2. Countdown Timer Logik ---
|
||||
const timerElement = document.querySelector('.mm-countdown-timer');
|
||||
|
||||
if (timerElement) {
|
||||
const targetDateString = timerElement.getAttribute('data-date');
|
||||
const expiredMessage = timerElement.getAttribute('data-expired');
|
||||
|
||||
// Prüfen ob Datum gesetzt ist
|
||||
if (targetDateString) {
|
||||
const countDownDate = new Date(targetDateString).getTime();
|
||||
|
||||
const updateTimer = setInterval(function() {
|
||||
const now = new Date().getTime();
|
||||
const distance = countDownDate - now;
|
||||
|
||||
if (distance < 0) {
|
||||
clearInterval(updateTimer);
|
||||
timerElement.innerHTML = expiredMessage;
|
||||
// Optional: Rot einfärben wenn abgelaufen
|
||||
timerElement.style.color = '#ff3333';
|
||||
return;
|
||||
}
|
||||
|
||||
// Zeitberechnung
|
||||
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
||||
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
||||
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
||||
|
||||
// Formatierung (z.B. 05 statt 5)
|
||||
const fDays = days > 0 ? days + "d " : "";
|
||||
const fHours = hours < 10 ? "0" + hours : hours;
|
||||
const fMinutes = minutes < 10 ? "0" + minutes : minutes;
|
||||
const fSeconds = seconds < 10 ? "0" + seconds : seconds;
|
||||
|
||||
timerElement.innerHTML = fDays + fHours + ":" + fMinutes + ":" + fSeconds;
|
||||
}, 1000);
|
||||
|
||||
// Sofort einmal ausführen, um Ladezeit zu vermeiden
|
||||
// Wir lösen das Interval manuell für den ersten Durchlauf aus,
|
||||
// indem wir den Code kopieren oder den Timeout kurz setzen.
|
||||
// Für diesen Fall reicht der erste Tick nach 1 Sekunde,
|
||||
// aber wir können es direkt aufrufen:
|
||||
// (Hier nutzen wir einfach den ersten Tick des Intervals)
|
||||
} else {
|
||||
timerElement.style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
19
Minecraft-Modern-Theme/js/login-script.js
Normal file
19
Minecraft-Modern-Theme/js/login-script.js
Normal file
@@ -0,0 +1,19 @@
|
||||
jQuery(document).ready(function($) {
|
||||
// Warte, bis das DOM vollständig geladen ist
|
||||
// Wir erstellen einen Wrapper um den Avatar-Slider und das Formular, um das Flexbox-Layout zu ermöglichen.
|
||||
const avatar = $('#minecraft-avatar-slider');
|
||||
const form = $('#loginform');
|
||||
|
||||
// Nur ausführen, wenn beide Elemente existieren
|
||||
if (avatar.length && form.length) {
|
||||
// Erstelle einen neuen Wrapper-Div
|
||||
const wrapper = $('<div id="login-content-wrapper"></div>');
|
||||
|
||||
// Füge den Wrapper vor dem Formular in den #login Container ein
|
||||
form.before(wrapper);
|
||||
|
||||
// Verschiebe den Avatar-Slider und das Formular in den Wrapper
|
||||
wrapper.append(avatar);
|
||||
wrapper.append(form);
|
||||
}
|
||||
});
|
||||
25
Minecraft-Modern-Theme/js/login-slider.js
Normal file
25
Minecraft-Modern-Theme/js/login-slider.js
Normal file
@@ -0,0 +1,25 @@
|
||||
jQuery(document).ready(function($) {
|
||||
const slider = $('#minecraft-avatar-slider');
|
||||
const slides = slider.find('.avatar-slide');
|
||||
|
||||
// Nur starten, wenn es mehr als einen Slide gibt
|
||||
if (slides.length > 1) {
|
||||
let currentIndex = 0;
|
||||
|
||||
function showSlide(index) {
|
||||
slides.removeClass('avatar-slide-active');
|
||||
slides.eq(index).addClass('avatar-slide-active');
|
||||
}
|
||||
|
||||
function nextSlide() {
|
||||
currentIndex = (currentIndex + 1) % slides.length;
|
||||
showSlide(currentIndex);
|
||||
}
|
||||
|
||||
// Geschwindigkeit aus den WordPress-Einstellungen holen
|
||||
const speed = avatarSliderSettings.speed || 4000;
|
||||
|
||||
// Den Slider alle X Sekunden wechseln
|
||||
setInterval(nextSlide, speed);
|
||||
}
|
||||
});
|
||||
158
Minecraft-Modern-Theme/js/mm-announcement-admin.js
Normal file
158
Minecraft-Modern-Theme/js/mm-announcement-admin.js
Normal file
@@ -0,0 +1,158 @@
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
|
||||
const fonts = window.MM_Announcement_Fonts || {};
|
||||
const current = window.MM_Announcement_Current || {};
|
||||
const fontSelect = $('#mm-announcement-font');
|
||||
const sizeInput = $('#mm-announcement-size');
|
||||
const bgInput = $('#mm-announcement-bg');
|
||||
const colorInput = $('#mm-announcement-color');
|
||||
const previewText = $('#mm-announcement-preview-text');
|
||||
const previewWrap = $('#mm-announcement-preview');
|
||||
const positionSelect = $('#mm-announcement-position');
|
||||
|
||||
// Helper: lädt Google-Font-Link oder updatet existing
|
||||
function ensureGoogleFont(googleName) {
|
||||
if (!googleName) return;
|
||||
const id = 'mm-admin-google-font';
|
||||
const href = 'https://fonts.googleapis.com/css2?family=' + encodeURIComponent(googleName) + ':wght@400;700&display=swap';
|
||||
let link = document.getElementById(id);
|
||||
if (link) {
|
||||
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
|
||||
} else {
|
||||
link = document.createElement('link');
|
||||
link.id = id;
|
||||
link.rel = 'stylesheet';
|
||||
link.href = href;
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
// Update preview appearance based on font key
|
||||
function updatePreviewForFontKey(key) {
|
||||
const meta = fonts[key];
|
||||
if (!meta) {
|
||||
previewText.css('font-family', '');
|
||||
return;
|
||||
}
|
||||
previewText.css('font-family', meta.css);
|
||||
if (meta.google && meta.google_name) {
|
||||
ensureGoogleFont(meta.google_name);
|
||||
}
|
||||
}
|
||||
|
||||
// Update size/colors/position UI
|
||||
function updateSizeAndColors() {
|
||||
const size = parseInt(sizeInput.val(), 10) || 16;
|
||||
previewText.css('font-size', size + 'px');
|
||||
previewWrap.css('background', bgInput.val());
|
||||
previewWrap.css('color', colorInput.val());
|
||||
}
|
||||
|
||||
// Read content from wp_editor (TinyMCE) or textarea
|
||||
function getEditorText() {
|
||||
// Try TinyMCE first
|
||||
if ( typeof tinymce !== 'undefined' ) {
|
||||
try {
|
||||
const ed = tinymce.get('mm_announcement_text');
|
||||
if (ed && !ed.isHidden()) {
|
||||
// getContent then strip tags
|
||||
const html = ed.getContent({format: 'html'});
|
||||
const tmp = document.createElement('div');
|
||||
tmp.innerHTML = html;
|
||||
return tmp.textContent || tmp.innerText || '';
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
// Fallback to textarea
|
||||
const ta = $('#mm_announcement_text');
|
||||
if (ta.length) {
|
||||
const tmp = document.createElement('div');
|
||||
tmp.innerHTML = ta.val();
|
||||
return tmp.textContent || tmp.innerText || '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
// Update preview text from editor content
|
||||
function updatePreviewTextFromEditor() {
|
||||
const text = getEditorText();
|
||||
if (text && text.trim().length) {
|
||||
previewText.text(text.trim());
|
||||
} else {
|
||||
previewText.text(current.text || 'Das ist eine Vorschau: Wie sieht die Schrift aus?');
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize controls with current settings
|
||||
if (current.font) {
|
||||
updatePreviewForFontKey(current.font);
|
||||
fontSelect.val(current.font);
|
||||
} else {
|
||||
updatePreviewForFontKey(fontSelect.val());
|
||||
}
|
||||
if (current.size) sizeInput.val(current.size);
|
||||
if (current.bg) bgInput.val(current.bg);
|
||||
if (current.color) colorInput.val(current.color);
|
||||
|
||||
updateSizeAndColors();
|
||||
updatePreviewTextFromEditor();
|
||||
|
||||
// Attach events --------------------------------------------------
|
||||
|
||||
// font change
|
||||
fontSelect.on('change', function(){
|
||||
const key = $(this).val();
|
||||
updatePreviewForFontKey(key);
|
||||
});
|
||||
|
||||
// size/color/position change
|
||||
sizeInput.on('input change', updateSizeAndColors );
|
||||
bgInput.on('input change', updateSizeAndColors );
|
||||
colorInput.on('input change', updateSizeAndColors );
|
||||
|
||||
// Editor changes:
|
||||
// - TinyMCE: listen for keyup / change events when editor is ready
|
||||
// - Textarea: listen for input
|
||||
function attachEditorListeners() {
|
||||
// TinyMCE
|
||||
if ( typeof tinymce !== 'undefined' ) {
|
||||
const ed = tinymce.get('mm_announcement_text');
|
||||
if (ed) {
|
||||
ed.on('keyup change NodeChange', function(){
|
||||
updatePreviewTextFromEditor();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Textarea fallback
|
||||
$('#mm_announcement_text').on('input change', function(){
|
||||
updatePreviewTextFromEditor();
|
||||
});
|
||||
}
|
||||
|
||||
// TinyMCE initialisation might be async — poll short time then attach
|
||||
let tries = 0;
|
||||
const waitForEditor = setInterval(function(){
|
||||
tries++;
|
||||
if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) {
|
||||
clearInterval(waitForEditor);
|
||||
attachEditorListeners();
|
||||
} else if (tries > 30) { // about 3s
|
||||
clearInterval(waitForEditor);
|
||||
// still attach textarea event just in case
|
||||
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
// Also update preview when the form is programmatically changed (e.g., quicktags)
|
||||
$(document).on('change', '#mm-announcement-font, #mm-announcement-size, #mm-announcement-bg, #mm-announcement-color', function(){
|
||||
updateSizeAndColors();
|
||||
updatePreviewForFontKey($('#mm-announcement-font').val());
|
||||
updatePreviewTextFromEditor();
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
40
Minecraft-Modern-Theme/js/navigation.js
Normal file
40
Minecraft-Modern-Theme/js/navigation.js
Normal file
@@ -0,0 +1,40 @@
|
||||
( function() {
|
||||
const siteNavigation = document.getElementById( 'site-navigation' );
|
||||
const menuToggle = siteNavigation.querySelector( '.menu-toggle' );
|
||||
|
||||
// Early exit wenn kein Toggle da ist
|
||||
if ( ! menuToggle ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Toggle Klassen hinzufügen (Menü öffnen/schließen)
|
||||
menuToggle.addEventListener( 'click', function() {
|
||||
siteNavigation.classList.toggle( 'toggled' );
|
||||
|
||||
// Aria States aktualisieren
|
||||
if ( menuToggle.getAttribute( 'aria-expanded' ) === 'true' ) {
|
||||
menuToggle.setAttribute( 'aria-expanded', 'false' );
|
||||
menuToggle.innerHTML = '<i class="fas fa-bars"></i>';
|
||||
} else {
|
||||
menuToggle.setAttribute( 'aria-expanded', 'true' );
|
||||
menuToggle.innerHTML = '<i class="fas fa-times"></i>';
|
||||
}
|
||||
} );
|
||||
|
||||
// Mobile Submenu Toggle (Klick auf Parent-Item öffnet Untermenü)
|
||||
const subMenuParents = siteNavigation.querySelectorAll( '.menu-item-has-children' );
|
||||
|
||||
subMenuParents.forEach( function( subMenuParent ) {
|
||||
subMenuParent.addEventListener( 'click', function( e ) {
|
||||
// Nur auf Mobil aktivieren (Media Query Check)
|
||||
if ( window.innerWidth <= 992 ) {
|
||||
// Optional: Verhindern, dass der Link geklickt wird, wenn man nur das Menü öffnen will
|
||||
// e.preventDefault();
|
||||
|
||||
// Klasse 'active' umschalten für das CSS Display
|
||||
this.classList.toggle( 'active' );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
} )();
|
||||
30
Minecraft-Modern-Theme/js/scroll-to-top.js
Normal file
30
Minecraft-Modern-Theme/js/scroll-to-top.js
Normal file
@@ -0,0 +1,30 @@
|
||||
jQuery(document).ready(function($) {
|
||||
// Wähle den Button aus
|
||||
var scrollButton = $('#scroll-to-top');
|
||||
|
||||
// Funktion zum Anzeigen oder Verstecken des Buttons
|
||||
function toggleScrollButton() {
|
||||
// Wenn mehr als 300px gescrollt wurde, zeige den Button
|
||||
if ($(window).scrollTop() > 300) {
|
||||
scrollButton.addClass('show');
|
||||
} else {
|
||||
scrollButton.removeClass('show');
|
||||
}
|
||||
}
|
||||
|
||||
// Event Listener für das Scrollen
|
||||
$(window).on('scroll', function() {
|
||||
toggleScrollButton();
|
||||
});
|
||||
|
||||
// Event Listener für den Klick auf den Button
|
||||
scrollButton.on('click', function(e) {
|
||||
// Verhindere das Standardverhalten des Links
|
||||
e.preventDefault();
|
||||
|
||||
// Scrolle die Seite sanft nach oben
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 800); // 800ms für eine sanfte Animation
|
||||
});
|
||||
});
|
||||
@@ -1,55 +1,52 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Hole den Slider-Container
|
||||
const heroSlider = document.querySelector('.hero-slider');
|
||||
|
||||
// Stelle sicher, dass der Slider auf der Seite existiert, bevor du versuchst, ihn zu konfigurieren
|
||||
if (!heroSlider) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Konfiguration für den Slider vorbereiten
|
||||
const swiperConfig = {
|
||||
// Optionen für den Slider
|
||||
loop: true, // Endloses Schleifen
|
||||
|
||||
// Autoplay
|
||||
autoplay: {
|
||||
delay: 5000, // 5 Sekunden pro Slide
|
||||
disableOnInteraction: false, // Autoplay nicht nach Klick stoppen
|
||||
},
|
||||
|
||||
// Wenn der Nutzer die Maus darüber bewegt, pausieren
|
||||
pauseOnMouseEnter: true,
|
||||
|
||||
// Effekt
|
||||
effect: 'fade', // Übergangseffekt: 'slide', 'fade', 'cube', etc.
|
||||
fadeEffect: {
|
||||
crossFade: true
|
||||
}
|
||||
};
|
||||
|
||||
// Prüfe, ob die Pfeile ausgeblendet werden sollen
|
||||
if (sliderSettings.hideArrows === '1') {
|
||||
heroSlider.classList.add('slider-hide-arrows');
|
||||
} else {
|
||||
// Navigation nur hinzufügen, wenn sie nicht ausgeblendet wird
|
||||
swiperConfig.navigation = {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
};
|
||||
}
|
||||
|
||||
// Prüfe, ob die Paginierung ausgeblendet werden soll
|
||||
if (sliderSettings.hidePagination === '1') {
|
||||
heroSlider.classList.add('slider-hide-pagination');
|
||||
} else {
|
||||
// Pagination nur hinzufügen, wenn sie nicht ausgeblendet wird
|
||||
swiperConfig.pagination = {
|
||||
el: '.swiper-pagination',
|
||||
clickable: true, // Klick auf Punkt springt zum Slide
|
||||
};
|
||||
}
|
||||
|
||||
// Initialisiere den Slider mit der konfigurierten Optionen
|
||||
new Swiper('.hero-slider', swiperConfig);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Hole den Slider-Container
|
||||
const heroSlider = document.querySelector('.hero-slider');
|
||||
|
||||
// Stelle sicher, dass der Slider auf der Seite existiert
|
||||
if (!heroSlider) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Konfiguration für den Slider vorbereiten
|
||||
const swiperConfig = {
|
||||
// Der Effekt ist jetzt fest auf "Überblenden" eingestellt
|
||||
effect: 'fade',
|
||||
fadeEffect: {
|
||||
crossFade: true
|
||||
},
|
||||
|
||||
// Loop-Einstellung ist jetzt DYNAMISCH
|
||||
loop: sliderSettings.loop === '1',
|
||||
|
||||
// Autoplay
|
||||
autoplay: {
|
||||
delay: 5000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
|
||||
pauseOnMouseEnter: true,
|
||||
|
||||
// Prüfe, ob die Pfeile NICHT ausgeblendet werden sollen
|
||||
navigation: sliderSettings.hideArrows !== '1' ? {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
} : false,
|
||||
|
||||
// Prüfe, ob die Paginierung NICHT ausgeblendet werden soll
|
||||
pagination: sliderSettings.hidePagination !== '1' ? {
|
||||
el: '.swiper-pagination',
|
||||
clickable: true,
|
||||
} : false,
|
||||
|
||||
on: {
|
||||
init: function () {
|
||||
setTimeout(() => {
|
||||
heroSlider.classList.add('swiper-initialized');
|
||||
}, 50);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// Initialisiere den Slider mit der konfigurierten Optionen
|
||||
new Swiper('.hero-slider', swiperConfig);
|
||||
});
|
||||
84
Minecraft-Modern-Theme/page-login.php
Normal file
84
Minecraft-Modern-Theme/page-login.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*
|
||||
Template Name: Benutzerdefinierte Authentifizierungsseite
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div class="container">
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
<div class="custom-auth-container">
|
||||
<?php if (is_user_logged_in()) : ?>
|
||||
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
|
||||
<div class="logged-in-message">
|
||||
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
|
||||
<p>Du bist bereits angemeldet.</p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" class="button">Abmelden</a>
|
||||
<a href="<?php echo esc_url(admin_url()); ?>" class="button">Zum Dashboard</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
|
||||
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
|
||||
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
|
||||
|
||||
<?php
|
||||
// Zeige das Registrierungsformular an
|
||||
$args = array(
|
||||
'echo' => true,
|
||||
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
|
||||
'form_id' => 'custom_registerform',
|
||||
'label_username' => __( 'Benutzername' ),
|
||||
'label_email' => __( 'E-Mail-Adresse' ),
|
||||
'label_password' => __( 'Passwort' ),
|
||||
'label_remember' => __( 'Angemeldet bleiben' ),
|
||||
'label_log_in' => __( 'Registrieren' ),
|
||||
'id_username' => 'user_login',
|
||||
'id_email' => 'user_email',
|
||||
'id_password' => 'user_pass',
|
||||
'id_remember' => 'rememberme',
|
||||
'id_submit' => 'wp-submit',
|
||||
'remember' => true,
|
||||
'value_username' => NULL,
|
||||
'value_remember' => false
|
||||
);
|
||||
wp_register_form($args);
|
||||
?>
|
||||
|
||||
<div class="login-form-link">
|
||||
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
|
||||
$auth_bg_image = get_theme_mod('login_background_image');
|
||||
if ($auth_bg_image):
|
||||
?>
|
||||
<style>
|
||||
body.login, body.login-action-register {
|
||||
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
|
||||
background-size: cover !important;
|
||||
background-position: center !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
body.login::before, body.login-action-register::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(20, 21, 26, 0.8);
|
||||
z-index: -1;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
BIN
Minecraft-Modern-Theme/screenshot.PNG
Normal file
BIN
Minecraft-Modern-Theme/screenshot.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
File diff suppressed because it is too large
Load Diff
335
README.md
335
README.md
@@ -1,2 +1,335 @@
|
||||
# Minecraft-Modern-Theme
|
||||
# Minecraft Modern Theme
|
||||
|
||||
Ein modernes und flexibles WordPress-Theme, perfekt für Minecraft-Server, Gaming-Communities und Gamer-Blogs. Passe deine Seite mit wenigen Klicks ganz nach deinem Stil an!
|
||||
|
||||
<div align="center">
|
||||
<img src="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/raw/branch/main/Minecraft-Modern-Theme/screenshot.PNG" alt="Theme Screenshot" style="max-width: 500px; width: 100%; height: auto; border-radius: 8px;">
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Hauptfunktionen
|
||||
|
||||
### Design & Layout
|
||||
- **🎨 Dynamischer Header-Slider** – Bis zu 5 Banner mit individuellem Text, Effekten und Animationen
|
||||
- **🌙 Dark & Light Mode** – Besucher wählen zwischen dunklem und hellem Design
|
||||
- **🎨 Komplette Farbanpassung** – Eigene Akzent- und Hintergrundfarbe
|
||||
- **📱 Responsive Design** – Optimiert für Desktop, Tablet und Smartphone
|
||||
- **⬆️ „Nach oben"-Button** – Ein- und ausschaltbar im Customizer
|
||||
- **🔤 4 Menü-Layouts** – Classic, Zentriert, Sidebar, Mega-Menü (wählbar im Customizer)
|
||||
- **🌐 Social Media Integration** – Discord, YouTube, Twitter, TikTok, Twitch, Steam, GitHub und mehr
|
||||
|
||||
### Inhalts-Module
|
||||
- **❓ FAQ-System** – Eigene FAQ-Seite mit Kategorien und Tab-Navigation, ohne Plugin
|
||||
- **👥 Team-Manager** – Teammitglieder mit Minecraft-Avatar (UUID), Rang, Bio und Banner-Bild verwalten
|
||||
- **🎬 Video-Galerie** – Videos von YouTube, Vimeo, Twitch und MP4-Dateien einbinden; Lightbox-Player, Kategorie-Filter
|
||||
- **📋 Bewerbungsformular** – Spieler können sich direkt auf der Website bewerben; Einreichungen im Admin-Backend mit Statusverwaltung
|
||||
|
||||
### Header & Navigation
|
||||
- **📢 Announcement Bar** – Auffällige Leiste oberhalb oder unterhalb des Headers mit individuellem Text, Farbe, Schrift und optionalem Countdown-Timer
|
||||
- **🔍 Suche im Header** – Suchfeld direkt im Header per Toggle-Button
|
||||
- **📌 Beitrag Sidebar** – Sidebar auf Einzelbeitrags-Seiten mit Positions- und Inhaltseinstellungen
|
||||
- **🍞 Breadcrumb** – Ein- und ausschaltbar auf Einzelbeitrags-Seiten
|
||||
|
||||
### DSGVO & Datenschutz
|
||||
- **🍪 Cookie-Banner (DSGVO)** – 4 Design-Varianten (Schmale Bar, Zweispaltig, Slide-In, Stepper) mit 3 Kategorien (Notwendig, Statistik, Marketing), automatischer iframe-Blockierung und optionaler Google Analytics Integration
|
||||
- **📄 Shortcode `[cookie_settings]`** – Link zum erneuten Öffnen der Cookie-Einstellungen
|
||||
|
||||
### Login
|
||||
- **🔐 Angepasste Login-Seite** – Eigenes Logo, Hintergrundbild und Minecraft-Avatar-Slider
|
||||
- **👤 Avatar-Slider** – Bis zu 5 Minecraft-Avatare per UUID
|
||||
|
||||
### Technisches
|
||||
- **📦 Import / Export** – Alle Theme-Einstellungen, Widgets, FAQs, Team und Custom CSS exportieren und importieren
|
||||
- **🔄 Automatische Theme-Updates** – Über Gitea-Repository
|
||||
- **♿ Barrierefreiheit** – ARIA-Labels, Keyboard-Navigation, Focus-States
|
||||
|
||||
---
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
1. **Lade das Theme herunter** – `minecraft-modern.zip` herunterladen
|
||||
2. **In WordPress hochladen** – Dashboard → Design → Themes → Installieren → Theme hochladen
|
||||
3. **Aktivieren** – Nach der Installation auf „Aktivieren" klicken
|
||||
|
||||
---
|
||||
|
||||
## 👶 Child Theme verwenden
|
||||
|
||||
Für eigene Code-Anpassungen unbedingt das mitgelieferte **Child Theme** verwenden, damit Änderungen bei Updates nicht überschrieben werden.
|
||||
|
||||
1. `minecraft-modern-child.zip` hochladen und installieren
|
||||
2. Child Theme aktivieren
|
||||
3. Das Haupt-Theme bleibt installiert, darf aber nicht aktiviert sein
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Einstellungen im Customizer
|
||||
|
||||
Alle Einstellungen unter **Design → Anpassen**.
|
||||
|
||||
### Header Slider
|
||||
- Slider aktivieren/deaktivieren
|
||||
- Bis zu 5 Bilder, Titel, Untertitel
|
||||
- Schriftart, -größe, -farbe
|
||||
- Übergangseffekt (Überblenden, Würfel, …)
|
||||
- Pfeile und Punkte ausblenden
|
||||
|
||||
### Farben & Darstellung
|
||||
- Akzentfarbe (Buttons, Links, Highlights)
|
||||
- Hintergrundfarbe
|
||||
- Standard Dark / Light Mode
|
||||
|
||||
### Menü-Design
|
||||
- **Classic** – Logo links, Menü Mitte, Icons rechts
|
||||
- **Zentriert** – Logo oben, Menü darunter
|
||||
- **Sidebar** – Vertikale Menüleiste
|
||||
- **Mega-Menü** – Breite Dropdown-Spalten
|
||||
- Logo-/Titel-Position: Links, Mitte, Rechts
|
||||
|
||||
### Social Media Links
|
||||
Discord, YouTube, Twitter/X, Facebook, Instagram, TikTok, Twitch, Steam, GitHub, LinkedIn, Pinterest, Reddit, TeamSpeak, Spotify
|
||||
|
||||
### Footer-Einstellungen
|
||||
- Copyright-Text
|
||||
- Impressum- und Datenschutz-URLs
|
||||
- „Erstellt von"-Verweis ausblenden
|
||||
|
||||
### FAQ Einstellungen
|
||||
- FAQ-System aktivieren/deaktivieren
|
||||
- Automatische Seitenerstellung
|
||||
|
||||
### Team Einstellungen
|
||||
- Team-Modul aktivieren/deaktivieren
|
||||
- Automatische Seitenerstellung
|
||||
|
||||
### Login-Einstellungen
|
||||
- Hintergrundbild und Logo
|
||||
- Bis zu 5 Avatar-UUIDs
|
||||
- Slider-Geschwindigkeit
|
||||
|
||||
### Beitrag Sidebar
|
||||
- Sidebar ein-/ausschalten
|
||||
- Position: Links oder Rechts
|
||||
- **Breadcrumb** ein-/ausschalten
|
||||
- **Ähnliche Beiträge** ein-/ausschalten
|
||||
|
||||
### Cookie-Banner (DSGVO)
|
||||
- Aktivieren/Deaktivieren
|
||||
- **4 Design-Varianten:**
|
||||
- Variante 1 – Schmale Bar (volle Breite)
|
||||
- Variante 2 – Zweispaltig (3A)
|
||||
- Variante 3 – Slide-In von rechts (3B)
|
||||
- Variante 4 – Kompakt-Center mit Stepper (3C)
|
||||
- Banner-Text
|
||||
- URL zur Datenschutzerklärung
|
||||
- Beschreibungen für alle 3 Cookie-Kategorien
|
||||
- Google Analytics ID (wird nur nach Zustimmung geladen)
|
||||
- Cookie-Laufzeit in Tagen
|
||||
- Live-Vorschau direkt im Customizer
|
||||
|
||||
### Bewerbungsformular
|
||||
- Aktivieren/Deaktivieren
|
||||
- Seitentitel und Beschreibungstext
|
||||
- Erfolgsmeldung nach dem Absenden
|
||||
- Mindestalter einstellen
|
||||
|
||||
---
|
||||
|
||||
## 📢 Announcement Bar (Admin-Menü)
|
||||
|
||||
Eigener Menüpunkt **„Ankündigung"** im WordPress-Admin.
|
||||
|
||||
- Text mit HTML und Icons
|
||||
- Hintergrund- und Textfarbe
|
||||
- Schriftfamilie und -größe (30+ Google Fonts)
|
||||
- Position: Über oder unter dem Header
|
||||
- **Countdown-Timer** – Zieldatum und Ablauf-Nachricht einstellbar
|
||||
- Live-Vorschau direkt auf der Admin-Seite
|
||||
|
||||
---
|
||||
|
||||
## 👥 Team Manager (Admin-Menü)
|
||||
|
||||
Eigener Menüpunkt **„Team Manager"** im WordPress-Admin.
|
||||
|
||||
- Mitglieder hinzufügen, bearbeiten, löschen
|
||||
- **Minecraft UUID** → Avatar wird automatisch geladen
|
||||
- Alternativ: eigenes Avatar-Bild hochladen
|
||||
- Banner-Bild pro Mitglied
|
||||
- Sortierung per Drag & Drop (▲▼)
|
||||
- Rang/Position, Bio, alle Felder inline editierbar
|
||||
|
||||
---
|
||||
|
||||
## 🎬 Video-System
|
||||
|
||||
### Verwaltung
|
||||
Menüpunkt **„Videos"** im WordPress-Admin.
|
||||
|
||||
- Titel, Vorschaubild, Beschreibung
|
||||
- Video-URL einfügen (normale Seiten-URL reicht)
|
||||
- Shortcode wird automatisch angezeigt und kann kopiert werden
|
||||
- Kategorie zum Filtern
|
||||
|
||||
### Unterstützte Plattformen
|
||||
| Plattform | Beispiel-URL |
|
||||
|-----------|-------------|
|
||||
| YouTube | `https://www.youtube.com/watch?v=…` |
|
||||
| YouTube Shorts | `https://youtube.com/shorts/…` |
|
||||
| Vimeo | `https://vimeo.com/123456` |
|
||||
| Twitch VOD | `https://twitch.tv/videos/123456` |
|
||||
| Twitch Stream | `https://twitch.tv/kanalname` |
|
||||
| Direkte MP4 | `https://example.com/video.mp4` |
|
||||
|
||||
### Galerie-Seite
|
||||
Automatisch unter `deine-seite.de/videos/` erreichbar.
|
||||
- Grid-Layout mit Thumbnail (YouTube-Thumbnail automatisch)
|
||||
- Lightbox-Player beim Klick
|
||||
- Kategorie-Filter-Tabs
|
||||
- Plattform-Badge je Video
|
||||
|
||||
### Shortcode
|
||||
```
|
||||
[mm_video url="https://www.youtube.com/watch?v=VIDEOID"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 Bewerbungsformular
|
||||
|
||||
### Formular-Felder
|
||||
- Minecraft Username (mit Live-Avatar-Vorschau)
|
||||
- Discord Username
|
||||
- Alter (mit Mindestalter-Prüfung)
|
||||
- Warum möchtest du mitspielen? (mit Zeichenzähler)
|
||||
- Erfahrung & Vorstellung (mit Zeichenzähler)
|
||||
|
||||
### Admin-Backend
|
||||
Menüpunkt **„Bewerbungen"** im WordPress-Admin.
|
||||
|
||||
- Übersichtstabelle mit Avatar, MC-Name, Discord, Alter, Status
|
||||
- Detailansicht mit allen Antworten
|
||||
- **Status pro Bewerbung:** Neu / In Prüfung / Angenommen / Abgelehnt
|
||||
- Interne Notiz pro Bewerbung
|
||||
- Doppelbewerbungsschutz (gleicher MC-Name: 30 Tage Sperre)
|
||||
|
||||
### Aktivierung
|
||||
Customizer → „Bewerbungsformular" → Checkbox aktivieren
|
||||
→ Seite `deine-seite.de/bewerbung/` wird automatisch angelegt
|
||||
|
||||
---
|
||||
|
||||
## 🍪 Cookie-Banner (DSGVO)
|
||||
|
||||
### 3 Kategorien
|
||||
| Kategorie | Beschreibung |
|
||||
|-----------|-------------|
|
||||
| Notwendige | Immer aktiv, nicht deaktivierbar |
|
||||
| Statistik | Google Analytics (wird nach Zustimmung geladen) |
|
||||
| Marketing | YouTube, Vimeo, Twitch, Facebook, Instagram u.v.m. |
|
||||
|
||||
### Automatische iframe-Blockierung
|
||||
Folgende Embeds werden automatisch blockiert bis Marketing akzeptiert wird:
|
||||
YouTube, Vimeo, Google Maps, Facebook, Twitter, TikTok, Instagram, Spotify, Twitch
|
||||
|
||||
### PHP-Hilfsfunktionen
|
||||
```php
|
||||
// Prüfen ob Kategorie akzeptiert wurde
|
||||
if ( mm_cookie_accepted('statistics') ) { /* Analytics-Code */ }
|
||||
if ( mm_cookie_accepted('marketing') ) { /* Marketing-Code */ }
|
||||
```
|
||||
|
||||
### Shortcode für Datenschutzseite
|
||||
```
|
||||
[cookie_settings text="Cookie-Einstellungen ändern"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📄 Verfügbare Template-Dateien
|
||||
|
||||
| Datei | Beschreibung |
|
||||
|-------|-------------|
|
||||
| `front-page.php` | Startseite mit Slider und Sidebar |
|
||||
| `single.php` | Einzelbeitrag mit Breadcrumb, Related Posts, Sidebar |
|
||||
| `archive.php` | Kategorie- und Tag-Archive |
|
||||
| `archive-team.php` | Team-Übersicht |
|
||||
| `archive-faq.php` | FAQ-Seite mit Tabs |
|
||||
| `archive-video.php` | Video-Galerie |
|
||||
| `page-bewerbung.php` | Bewerbungsformular |
|
||||
| `page-login.php` | Angepasste WordPress-Login-Seite |
|
||||
| `search.php` | Suchergebnisse |
|
||||
| `404.php` | Fehlerseite im Minecraft-Stil |
|
||||
| `comments.php` | Kommentarbereich |
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Shortcode-Übersicht
|
||||
|
||||
| Shortcode | Beschreibung |
|
||||
|-----------|-------------|
|
||||
| `[mm_video url="URL"]` | Video einbetten (YouTube, Vimeo, Twitch, MP4) |
|
||||
| `[cookie_settings]` | Link zum Öffnen der Cookie-Einstellungen |
|
||||
| `[cookie_settings text="…"]` | Mit eigenem Linktext |
|
||||
|
||||
---
|
||||
|
||||
## 📥 Import / Export
|
||||
|
||||
Unter **Design → Anpassen → Import/Export** kannst du alle Theme-Einstellungen sichern:
|
||||
|
||||
**Enthält:**
|
||||
- Alle Customizer-Einstellungen
|
||||
- Announcement Bar Einstellungen
|
||||
- Widget-Konfigurationen
|
||||
- Team-Mitglieder
|
||||
- FAQ-Einträge
|
||||
- Custom CSS
|
||||
- Menü-Positionen
|
||||
|
||||
---
|
||||
|
||||
## 🗂️ Verzeichnisstruktur
|
||||
|
||||
```
|
||||
minecraft-modern/
|
||||
├── inc/
|
||||
│ ├── customizer.php – Customizer-Einstellungen
|
||||
│ └── theme-updater.php – Automatische Updates via Gitea
|
||||
├── js/
|
||||
│ ├── header-scroll.js – Header-Scroll-Effekt + Suche-Toggle
|
||||
│ ├── navigation.js – Menü-Toggle + Dropdown
|
||||
│ ├── slider-init.js – Swiper.js Initialisierung
|
||||
│ ├── theme-toggle.js – Dark/Light Mode
|
||||
│ ├── announcement.js – Announcement Bar + Countdown
|
||||
│ ├── login-slider.js – Avatar-Slider auf Login-Seite
|
||||
│ ├── faq-accordion.js – FAQ Accordion
|
||||
│ └── scroll-to-top.js – Nach-oben-Button
|
||||
├── css/
|
||||
│ ├── announcement.css – Announcement Bar Styles
|
||||
│ └── login-style.css – Login-Seite Styles
|
||||
├── functions.php – Haupt-Funktionsdatei
|
||||
├── style.css – Haupt-Stylesheet
|
||||
└── screenshot.PNG – Theme-Vorschaubild
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📜 Changelog
|
||||
|
||||
### Version aktuell
|
||||
- ✅ Cookie-Banner mit 4 Design-Varianten und DSGVO-Konformität
|
||||
- ✅ Video-System mit YouTube, Vimeo, Twitch, MP4
|
||||
- ✅ Bewerbungsformular mit Admin-Backend
|
||||
- ✅ Breadcrumb und Ähnliche Beiträge (ein-/ausschaltbar)
|
||||
- ✅ 4 Menü-Layout-Varianten
|
||||
- ✅ Announcement Bar mit Countdown
|
||||
- ✅ Team Manager mit UUID-Avatar
|
||||
- ✅ Import/Export komplett
|
||||
|
||||
---
|
||||
|
||||
**Copyright © 2026 - M_Viper - Alle Rechte vorbehalten**
|
||||
|
||||
Die unbefugte Vervielfältigung, Verbreitung oder Weitergabe dieses Themes ist strafbar und wird rechtlich verfolgt.
|
||||
Reference in New Issue
Block a user