Skip to content

Instantly share code, notes, and snippets.

View kLOsk's full-sized avatar
:octocat:
back in black

Daniel Klose kLOsk

:octocat:
back in black
View GitHub Profile
<?php
/**
* Disable header links
*/
/**
* Clean up wp_head()
*
* Remove unnecessary <link>'s
* Remove inline CSS and JS from WP emoji support
@kLOsk
kLOsk / functions.php
Created July 31, 2020 13:36
facetwp date url vars
<?php
//load current cw plus 4 weeks on front page date facet
add_filter( 'facetwp_preload_url_vars', function( $url_vars ) {
if ( '' == FWP()->helper->get_uri() ) {//frontpage
if ( empty( $url_vars['date_facet'] ) ) {
$week = date("W");
$year = date("Y");
$start_day = date("Y-m-d", strtotime("{$year}-W{$week}-1"));//return monday of this week
$end_day = date("Y-m-d", strtotime("{$year}-W{$week}-7 +3 weeks")); //return sunday in 4 weeks
//error_log($start_day);