Skip to content

Instantly share code, notes, and snippets.

@joxmar
joxmar / wp-query-ref.php
Created April 8, 2023 18:09 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@joxmar
joxmar / list_plugin_updates.php
Created February 23, 2023 20:46 — forked from franz-josef-kaiser/list_plugin_updates.php
WordPress Plugin: List all plugins that need updates in wp_footer()
<?php
/*
Plugin Name: Plugin update lister
Plugin URI: https://gist.github.com/995560
Description: Adds a table to your ´wp_footer()´ that lists all plugins that need updates. The plugin works out of the box.
Author: Franz Josef Kaiser
Author URI: https://github.com/franz-josef-kaiser
Version: 0.1.
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
@joxmar
joxmar / WP-Add-stylesheets-Frontend-Gutenberg.php
Last active February 24, 2023 22:07
WP Add stylesheets to Gutenberg and front end
<?
// Gutenberg work editor stylesheet
add_theme_support('editor-styles');
add_editor_style( 'work-editor-styles.css' );
// OR add the styles to specific custom post type
add_theme_support('editor-styles');
function wpdocs_theme_add_editor_styles() {
global $post;
@joxmar
joxmar / mailchimp-custom.js
Created March 14, 2022 14:36 — forked from macariojames/mailchimp-custom.js
MailChimp hide form on successful submit and thank you message; jQuery
// Add a surrounding <div> for all the ish don't want to keep once submission is successful
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[1]='FNAME';ftypes[1]='text';fnames[0]='EMAIL';ftypes[0]='email';}(jQuery));
//var $mcj = jQuery.noConflict(true);
</script>
<script>
$(function(){
//$("#mcm_hide_on_submit").hide();
$(".button").on("click", function(){
@joxmar
joxmar / rename-divi-projects-custom-post-type.php
Last active July 11, 2022 16:56 — forked from hbaker/rename-divi-projects-custom-post-type.php
Divi Theme - Rename Divi's 'Projects' Custom Post Type
//IMPORTANT: make sure you re-save permalinks after adding this.
// RENAME DIVI PROJECTS CUSTOM POST TYPE
function ze_rename_projects_cpt() {
register_post_type( 'project',
array(
'labels' => array(
'name' => __( 'Specials', 'divi' ), // CHANGE SPECIALS TO WHATEVER YOU WANT
'singular_name' => __( 'Special', 'divi' ), // CHANGE SPECIAL TO WHATEVER YOU WANT
),
'has_archive' => true,