Skip to content

Instantly share code, notes, and snippets.

View radarin's full-sized avatar

René A. Da Rin radarin

View GitHub Profile
box.hidden {
visibility: hidden;
}
box.hidden {
display: none;
}
@radarin
radarin / change-tld.php
Last active February 3, 2022 21:28
TLD einer Domain bei Aufruf ändern.
<?php
if ($_SERVER['HTTP_HOST'] == "computer-for-dummies.ch" OR $_SERVER['HTTP_HOST'] == "www.computer-for-dummies.ch")
{
?>
<meta http-equiv="refresh" content="0; URL=https://computer-for-dummies.info<?php echo $_SERVER['REQUEST_URI']?>">
<?php
}
?>
@radarin
radarin / year-today.php
Created January 27, 2022 21:35
Aktuelles Jahr ausgeben
Copyright 2000 - <?php echo date("Y", time() );?> by René A. Da Rin
<?php
function remove_some_widgets(){
unregister_sidebar( 'left-sidebar' );
unregister_sidebar( 'top-widget' );
}
add_action( 'widgets_init', 'remove_some_widgets', 11 );
?>
@radarin
radarin / wp-old-shortcode.php
Created April 19, 2020 18:09
Alten Shortcode unterdrücken
add_shortcode( 'pluginshortcode', '__return_false' );
<?php
// Silence is golden.
@radarin
radarin / wp.widget.theme.php
Last active March 1, 2020 22:52
Widget in WP Theme anzeigen
<?php if ( is_active_sidebar( 'neues_widget' ) ) : ?>
<?php dynamic_sidebar( 'neues_widget' ); ?>
<?php endif; ?>
@radarin
radarin / wp.widget.functions.php
Created March 1, 2020 21:48
Widget-Area ins WP Theme integrieren
<?php
function deinthemename_widgets_init() {
register_sidebar(array(
'name' => 'Widget Name',
'id' => 'neues_widget',
'description' => 'Eine zusätzliche Widget Area',
'before_widget' => '<div class=”juhu_ein_widget”>',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>',
@radarin
radarin / wp.snippet.hiddenmenu.php
Last active February 5, 2020 19:43
Worpress Menu Eintrag bei leerer Kategorie ausblenden
<?php
// Diese Funktion wird nur im Frontend angewendet
function shortcode_posts_function(){
// Parameter
$args = array(
'category' => '43', // Kategorie ID
'numberposts' => 1 // Anzahl der zu ladenden Beiträge
);
@radarin
radarin / gist:00a3885c88181bf98eb77f04eda4578c
Last active January 19, 2020 00:13
FileMaker: TriggerKeystroke/ScriptTrigger
Wenn [ Code(Get(TriggerKeystroke)) = 13 ]
---
hier Scriptfunktionen einfügen...
---
Ende (wenn)