Skip to content

Instantly share code, notes, and snippets.

View nuriye's full-sized avatar

Theresa Schmidt nuriye

View GitHub Profile
@nuriye
nuriye / gist:bb7d46dea64327b3ab7db9da882c8ae2
Last active November 30, 2018 13:35
Wordpress Date Format inkl Days to German
$date = date_create_from_format('j-m-d', get_the_date('j-m-d'));
$weekday = get_weekday_german($date);
function get_weekday_german($date) {
$weeksdays = array(
'Sunday' => 'Sonntag',
'Monday' => 'Montag',
'Tuesday' => 'Dienstag',
'Wednesday' => 'Mittwoch',
header-{name}.php
get_header('{name});
<script>
jQuery( document ).ready(function($) {
window.onscroll = function() {
getSticky();
};
var header = document.getElementById("wrapper-navbar");
var sticky = header.offsetTop;
/* Gravity Forms - weil PLZ mit Komma getrennt wurden 1,030 zB */
add_filter( 'gform_include_thousands_sep_pre_format_number', '__return_false' );
preg_match('/^([^.!?]*[\.!?]+){0,2}/', strip_tags($contentNoTags), $abstract);
echo $abstract[0];
$sWholeWord = substr($contentNoTags, 0, 200);
$resultWholeWord = substr($sWholeWord, 0, strrpos($sWholeWord, ' '));
$str = preg_replace('/<h2(.*?)<\/h2>/s', '', $contentNoShortcodes);
SELECT *, LENGTH(option_value) AS Laenge FROM `wp_options` ORDER BY Laenge DESC
function log_result($message) {
$pluginLog = wp_upload_dir()["basedir"] . '/wps_log_dev';
$pluginLogContents = file_get_contents($pluginLog);
$date = new DateTime();
$date = $date->setTimezone(new DateTimeZone('Europe/Berlin'));
$pluginLogContents .= $date->format('[d/M/Y:H:i:s\Z]') ."(Europe/Berlin) - " . $message . " --\n";
file_put_contents($pluginLog, $pluginLogContents);
}
add_shortcode('wps_event_link', 'wps_event_link');
function wps_event_link() {
$post_id = '{{ post_data:ID }}';
}