Skip to content

Instantly share code, notes, and snippets.

View mrkdevelopment's full-sized avatar

Matt Knighton mrkdevelopment

View GitHub Profile
@mrkdevelopment
mrkdevelopment / style.css
Last active March 28, 2024 07:06
CSS for Event Calendar Date Styling
.tribe-events .tribe-events-calendar-list__event-date-tag-datetime{
padding-top: 0;
}
.tribe-events-calendar-list__event-date-tag-daynum{
border-radius: 0 0 4px 4px;
border: 2px solid var(--global-palette5) !important;
display: block;
text-align: center;
font-size: 2rem !important;
text-decoration: none;
@mrkdevelopment
mrkdevelopment / anonymous_filter.php
Last active March 28, 2024 11:45
Stop access for 'Users' in REST Path for WordPress
<?php
// Check for pluggable function
if ( function_exists( 'is_user_logged_in' ) ) {
if ( ! is_user_logged_in() ) {
add_filter(
'rest_endpoints',
function ( $endpoints ) {
if ( isset( $endpoints['/wp/v2/users'] ) ) {
unset( $endpoints['/wp/v2/users'] );
}
@mrkdevelopment
mrkdevelopment / gist:d1f2b8fd9da3f5dbc2dd8269f93ff175
Created March 7, 2024 03:39
WP CLI Command for search and replace when sending a WP site live.
wp search-replace 'old.domain.com' 'new.domain.com' --precise --all-tables --skip-columns=guid,user_email --report-changed-only --dry-run
@mrkdevelopment
mrkdevelopment / gist:e5e7c274c11cb9ecd4274229df60f14e
Last active February 16, 2024 05:24
Security headers for cloudways
# Security Headers
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-Content-Type-Options "nosniff"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
Header set Content-Security-Policy "default-src 'self'"
Header set Referrer-Policy "same-origin"
Header set Feature-Policy "geolocation 'self'; vibrate 'none'"
</IfModule>
@mrkdevelopment
mrkdevelopment / margin.css
Created February 1, 2024 02:57
Global Margin Fix for Kadence Theme
.mrk-no-margin{
--global-md-spacing: 0.5rem;
}
@mrkdevelopment
mrkdevelopment / style.css
Last active January 18, 2024 00:38
Fix Events Calendar for Kadence Theme - width too wide issue
@media screen and (min-width: 1280px) {
.tribe-events.alignwide {
max-width: var(--global-content-width) !important;
margin-left: calc( 50% - ( var(--global-content-width) / 2 )) !important;
margin-right: calc( 50% - ( var(--global-content-width)/ 2 )) !important;
padding: 0 var(--global-content-edge-padding) !important;
}
}
@media screen and (max-width: 1279px) {
.tribe-events-view.alignwide {
@mrkdevelopment
mrkdevelopment / .sql
Created September 26, 2023 06:12
SQL Commands for clearing Scheduled Actions
DELETE FROM `wp_actionscheduler_actions` WHERE `status` = 'complete'
DELETE FROM `wp_actionscheduler_logs`;
@mrkdevelopment
mrkdevelopment / .bat
Last active August 25, 2023 11:12
Turn off default core block patterns
wp scaffold child-theme youtube-video --parent_theme=twentytwentythree
@mrkdevelopment
mrkdevelopment / functions.php
Created June 16, 2023 06:37
Remove core theme support
if ( ! function_exists( 'custom_setup' ) ) {
function custom_setup() {
// Remove core block patterns.
remove_theme_support( 'core-block-patterns' );
}
}
add_action( 'after_setup_theme', 'custom_setup' );
@mrkdevelopment
mrkdevelopment / yoast.css
Created June 15, 2023 15:15
Yoast table of Contents Styling for Kadence Blocks
.yoast-table-of-contents{
--border: 2px solid var(--global-palette1);
padding: 1rem;
background: var(--global-palette7);
border: var(--border);
box-shadow: var(--box-shadow);
border-radius: 1rem;
}
.yoast-table-of-contents ul{
padding-inline-start: 0.2em;