Skip to content

Instantly share code, notes, and snippets.

View gmmedia's full-sized avatar

Jochen Gererstorfer gmmedia

View GitHub Profile
/* Code Styles */
pre {
border-left: 9px solid #990000;
padding: 10px;
margin: 20px;
width: 95%;
line-height: 1.1em;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -o-pre-wrap;
<?php
// 1. --> Wordpress Settings //
// 2. --> SHORTCODES //
// 3. --> Plugin Settings //
// 4. --> Theme Settings //
// 1. --> Wordpress Settings //
// Remove junk from head
@gmmedia
gmmedia / Simple CSS Button
Last active December 31, 2016 11:34
Simple CSS Button
<!-- CSS stylings -->
<style>
a.button {
color: #990000;
background-color: #fff;
line-height: 85px;
font-size: 25px;
padding: 15px 35px;
border: 2px solid #990000;
border-radius: 5px;
@gmmedia
gmmedia / 0_reuse_code.js
Created April 2, 2017 08:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gmmedia
gmmedia / stopwords.txt
Last active November 26, 2017 18:42
Stopwords DE und EN
ab, aber, abgesehen, alle, allein, aller, alles, als, am, an, andere, anderen, anderenfalls, anderer, anderes, anstatt, auch, auf, aus, aussen, außen, ausser, außer, ausserdem, außerdem, außerhalb, ausserhalb, behalten, bei, beide, beiden, beider, beides, beinahe, bevor, bin, bis, bist, bitte, da, daher, danach, dann, darueber, darüber, darueberhinaus, darüberhinaus, darum, das, dass, daß, dem, den, der, des, deshalb, die, diese, diesem, diesen, dieser, dieses, dort, duerfte, duerften, duerftest, duerftet, dürfte, dürften, dürftest, dürftet, durch, durfte, durften, durftest, durftet, ein, eine, einem, einen, einer, eines, einige, einiger, einiges, entgegen, entweder, erscheinen, es, etwas, fast, fertig, fort, fuer, für, gegen, gegenueber, gegenüber, gehalten, geht, gemacht, gemaess, gemäß, genug, getan, getrennt, gewesen, gruendlich, gründlich, habe, haben, habt, haeufig, häufig, hast, hat, hatte, hatten, hattest, hattet, hier, hindurch, hintendran, hinter, hinunter, ich, ihm, ihnen, ihr, ihre, ihrem, ihren,
<?php
// Add featured image to RSS feed
function j0e_imagetoRSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '
' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'float:left; margin:0 10px 10px 0;' ) ) . '
' . $content;
}
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:08
Artikel und Seiten Aktualisierungsdatum
<?php
// Änderungsdatum automatisch einfügen
function j0e_change_date($content) {
if ( (is_single() && get_post_type() == 'post') || is_page() ) {
$artikel_erstellt = get_the_date('U');
$artikel_aktualisiert = get_post_modified_time('U');
// Nur ausgeben, wenn Aktualisierung älter als einen Tag ist
if (($artikel_aktualisiert - $artikel_erstellt) > 86400)
@gmmedia
gmmedia / AutoHotkey.ahk
Last active August 27, 2019 17:55
Deutsche Anführungszeichen unter Windows mit AutoHotkey
; Vollständiger Artikel auf https://j0e.org/forum/thread/anfuehrungszeichen/
; Deutsche Anführungszeichen unten und oben -> auf ALT+1 und Alt+2
!1::Send ; Alt+1 anstatt Alt+0132
!2::Send ; Alt+2 anstatt Alt+0147
; Französische Anführungszeichen, Chevrons oder Guillemets -> auf ALT+3 und Alt+4
!3::Send » ; Alt+3 anstatt Alt+0187
!4::Send « ; Alt+4 anstatt Alt+0171
@gmmedia
gmmedia / functions.php
Last active March 11, 2023 10:07
Astra Theme: Display only last modified date in the post metadata.
<?php
/**
* Astra Theme: Display only last modified date in the post metadata.
*
*/
function j0e_post_date( $output ) {
$output = '';
$format = apply_filters( 'astra_post_date_format', '' );
$modified_date = esc_html( get_the_modified_date( $format ) );
@gmmedia
gmmedia / .htaccess
Last active February 4, 2021 20:39
Perfect WordPress .htaccess
# WordPress .htaccess von Jochen Gererstorfer
# https://j0e.org/wordpress-htaccess/
# http zu https weiterleiten
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>