Skip to content

Instantly share code, notes, and snippets.

@jbd91
jbd91 / snippet.scss
Created July 31, 2019 19:13
BG image zoom on hover
.parent {
overflow: hidden;
&:hover {
.child {
transform: scale3d(1.1,1.1,1);
}
}
}
p:not(.fancy) {
color: green;
}
@jbd91
jbd91 / snippet.php
Created July 30, 2019 21:05
WP Query Shortcode -- Custom Post type using Custom Taxonomy
// create shortcode with parameters so that the user can define post queries
add_shortcode( 'recurring-events', 'recurring_events_parameters_shortcode' );
function recurring_events_parameters_shortcode( $atts ) {
ob_start();
// define attributes and their defaults
$a = shortcode_atts( array (
'type' => 'recurring_event',
'posts' => -1,
'categories' => '',
@jbd91
jbd91 / snippet.php
Created July 30, 2019 16:08
Add Settings Page to Custom Post Type
<?php
//Example from Codex page : http://codex.wordpress.org/Function_Reference/add_submenu_page
//Add this in your functions.php file, or use it in your plugin
add_action('admin_menu', 'register_my_custom_submenu_page');
function register_my_custom_submenu_page() {
add_submenu_page( 'edit.php?post_type=book', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' );
}
function my_custom_submenu_page_callback() {
echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>';
echo '<h2>My Custom Submenu Page</h2>';
@jbd91
jbd91 / snippet.php
Created June 19, 2019 16:54
fusion-blog.php read more element accessibility patch
// Lines 1364 - 1410 at /wp-content/plugins/fusion-builder/shortcodes/fusion-blog.php
// declared global $post variable on line 1390 and set title attribute to "Read more about $post -> post_title on line 1397
/**
* The read-more element.
*
* @access public
* @since 1.0
* @return string
*/
@jbd91
jbd91 / snippet.scss
Created May 8, 2019 20:55
Color Palettes
@mixin palette-1 {
$a: #f97761;
$b: #fa9652;
$c: #7874f6;
$d: #f5f8fd;
$e: #d2d9e6;
$f: #9fa4be;
}
@mixin palette-2 {
@jbd91
jbd91 / snippet.php
Created April 26, 2019 14:37
Detect if http(s) protocl is declared in string
<?php if (!preg_match('#^https?://#', $qnbv_tdl_website)) : ?>
<p><a href="//<?php echo $qnbv_tdl_website; ?>"
target="_blank"><?php echo $qnbv_tdl_website; ?></a></p>
<?php else : ?>
<p><a href="<?php echo $qnbv_tdl_website; ?>"
target="_blank"><?php echo $qnbv_tdl_website; ?></a></p>
@jbd91
jbd91 / snippet.txt
Created March 25, 2019 15:55
Wordpress Plugins
Image Map Pro
https://imagemappro.com/
@jbd91
jbd91 / snippet.txt
Created March 25, 2019 15:53
Javascript Libraries
Scroll Craft
https://webcraftplugins.com/scroll-craft-js/
@jbd91
jbd91 / snippet.js
Created October 25, 2018 15:28
If has class conditional
if ($('body').is('.class')) {
}