DELETE FROM `wp_posts` WHERE `post_status` LIKE ‘flamingo_spam’ or to complete claer flamingo content DELETE FROM wp_posts WHERE post_type LIKE ‘%flamingo%’
For more code ideas go to my GitHub gists:
https://gist.github.com/johnnya23
Block Color Picker
Within the edit function of block.js var el = wp.element.createElement, Fragment = wp.element.Fragment, registerBlockType = wp.blocks.registerBlockType, InspectorControls = wp.editor.InspectorControls, RadioControl = wp.components.RadioControl, ColorPicker = wp.components.ColorPicker;//this this el(‘div’, {}, ‘Menu Background’), el(ColorPicker, { type: ‘color’, color: menu_bg, onChangeComplete: function(newValue) { props.setAttributes({ menu_bg: newValue.hex }); }, disableAlpha: true }),
Add Arguments to WordPress Hooks
function jma_gbs_template_redirect() { $body = true; add_action( ‘genesis_before_sidebar_widget_area’, function () use ($body) { jma_gbs_open_div($body); } ); add_action( ‘genesis_before_loop’, function () use ($body) { jma_gbs_open_div($body); } ); add_action( ‘genesis_after_sidebar_widget_area’, function () use ($body) { jma_gbs_close_div($body); } ); add_action( ‘genesis_after_loop’, function () use ($body) { jma_gbs_close_div($body); } ); } add_action(‘template_redirect’, ‘jma_gbs_template_redirect’);
Debug
define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false);
Custom Fontawesome Icons for Lists
Add to functions.php function jma_child_scripts() { wp_add_inline_script(‘fontawesome’, ‘window.FontAwesomeConfig={searchPseudoElements:true}’, ‘before’); } add_action(‘wp_enqueue_scripts’, ‘jma_child_scripts’); The Css: /* get rid of the bullets */ #content ul li { list-style-type: none; } /* suppress the default fontawesome behavior */ #content ul li::before { display: none; font-style: normal; font-variant: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; } /* add your icon (right-angle […]
Uneven div Top
.custom-top { /*margin-top: 50px;*/ background-image: url(back.jpg); background-size: cover; position: relative; background-position: 0 -50px !important; } .custom-top::before { content: “”; position: absolute; width: 100%; height: 50px; top: -49px; left: 0; -webkit-clip-path: polygon(0% 100%, 15% 41%, 28% 84%, 45% 21%, 63% 84%, 77% 10%, 84% 95%, 94% 56%, 100% 100%); clip-path: polygon(0% 100%, 15% 41%, 28% 84%, […]
Add simple meta box(s)
/* * When the post is saved, saves our custom data. * * @param int $post_id The ID of the post being saved. */ /* * Adds a box to the main column on the Post and Page edit screens. */ function jma_add_linkedin_input_box() { $screens = array(‘volunteer’); foreach ($screens as $screen) { add_meta_box( ‘jma_linkedin_input_section’, __(‘Linkedin […]
Google Maps Responsive Setup
Settings: Map Width 75% Directions “Yes, below” width 25% /* maps */ .wpgmaps_directions_outer_div { padding-left: 5px; color: #ffffff } [id^=directions_panel], [id^=wpgmaps_directions] { background: #ffffff !important; clear: both } @media(min-width: 768px) { [id^=wpgmaps_directions] { float: left !important; clear: right !important; } } @media(max-width: 767px) { .wpgmza_map { width: 100% !important; } [id^=wpgmaps_directions] { width: 100% !important; […]
Title Filtering
What ever you do is going to end up within the h1 tag, but this will keep it out of the menu etc. function personnel_filter($x) { $value = get_field(‘position’); $x = ‘<div class=”person-sub”>’ . $value . ‘</div><!–person-sub–>’ . $x; return $x; } function jma_person_title_cond($query) { global $wp_query; if ($query === $wp_query) { add_filter(‘the_title’, ‘personnel_filter’, 10, […]