Skip to content

Instantly share code, notes, and snippets.

View izzycart's full-sized avatar

Emmanuel Kolawole izzycart

View GitHub Profile
@cferdinandi
cferdinandi / metabox-multiple.php
Last active April 25, 2023 17:29
Create a metabox with multiple fields
<?php
/**
* Create a metabox with multiple fields.
* Replace `_namespace` with some namespace for your project to avoid conflicts with other items
*/
//
// Create Metabox
//
@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 15, 2024 12:05
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@martijn94
martijn94 / wp-admin-add-posts-state.php
Last active May 2, 2023 04:43
Snippet to add post state to a WordPress page
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
@bfintal
bfintal / base-frame-template.php
Last active January 7, 2021 18:33
Since it's hard to find an example of how to create a readily usable modal popup using Backbone & WordPress, here's one that you can drop in your code and use right away.
<script type="text/html" id="tmpl-my-frame">
<div class="media-frame-title">
<h1>My Frame</h1>
</div>
<div class="media-frame-content"></div>
<div class="media-frame-toolbar">
<div class="media-toolbar">
<div class="media-toolbar-secondary"></div>
<div class="media-toolbar-primary search-form">
<button type="button" class="button button-primary media-button button-large">My Button</button>
// Shortcode
// source : https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362
if(!function_exists('carousel_content')){
function carousel_content( $atts, $content = null ) {
return '<div class="owl-carousel content-carousel content-slider">'.do_shortcode($content).'</div>';
}
add_shortcode('carousel_content', 'carousel_content');
}