Skip to content

Instantly share code, notes, and snippets.

@ellenmva
ellenmva / remove_dms_image_sizes.php
Created April 13, 2015 17:30
Remove DMS Image Sizes
<?php
// Do not copy above php tag if already present in functions.php file
add_action('init', 'remove_dms_image_sizes');
function remove_dms_image_sizes() {
// Remove the // in front of image sizes to remove
// remove_image_size('aspect-thumb');
// remove_image_size( 'basic-thumb');
@ellenmva
ellenmva / sb-dynamic-image.php
Last active August 29, 2015 14:17
Filter for elSue Single Bits for DMS that takes image from Dynamic Featured Image plugin and replaces as background for Single Bits container when Featured Image option is selected.
<?php
add_filter('elsue_bits_img_id' , 'sb_dynamic_image');
function sb_dynamic_image($thumb_id) {
global $post;
if( class_exists('Dynamic_Featured_Image') ) {
global $dynamic_featured_image;
// Get all dynmaic images
$featured_images = $dynamic_featured_image->get_featured_images( $post->ID );
@ellenmva
ellenmva / filtering-img.less
Created December 11, 2014 19:44
responsive image for Filtering on tablets and smartphones for larger item and image widths
@media only screen and (max-width: 767px) {
.section-filtering .filtering {
width: 100% !important;
}
.section-filtering .isotope .isotope-item {
max-width: 100% !important;
}
.section-filtering .filtering .filtering-image {
height: 100% !important;
@ellenmva
ellenmva / my-registered-post-type-handler.php
Created September 12, 2014 21:37
Change registered_post_type $args
<?php
add_action('registered_post_type', 'my_registered_post_type_handler', 10, 2);
function my_registered_post_type_handler($post_type, $args) {
do_action("my_registered_{$post_type}_post_type", $post_type, $args);
}
// Replace foo with your post type slug
add_action('my_registered_foo_post_type', 'my_registered_foo_post_type_handler', 10, 2);
function my_registered_foo_post_type_handler($post_type, $args) {
@ellenmva
ellenmva / user-fields.css
Created September 11, 2014 12:42
Add Cimy User Extra Fields Single Bits
@facebook: #3B5998;
@twitter: #00ACED;
.author-links {
text-align: center;
a {
margin-right: 10px; // Here in-case you wish to add margins
padding: 0px; // Here in-case you wish to add padding
}
li {
<?php
add_action('the_html_tag' , 'elsue_html_tag_schema');
function elsue_html_tag_schema($type) {
$schema = 'http://schema.org/';
// Is single post
if(is_single()) {
$type = "Article";
@ellenmva
ellenmva / less-vars.php
Last active August 29, 2015 14:03
Defining less vars in section
<?php
function section_persistent() {
add_filter('pless_vars',array($this,'customless_vars'));
}
// Custom LESS Vars
function customless_vars($less) {
$less['ba-ss-thumbs-height'] = $this->opt('ba_ss_thumbs_height') ? $this->opt('ba_ss_thumbs_height') : '341px';
$less['ba-ss-thumbs-margin'] = $this->opt('ba_ss_thumbs_margin') ? $this->opt('ba_ss_thumbs_margin') : '20'.'px';
<?php
// Any Post Widget
class BA_Template_Widget extends WP_Widget {
function BA_Template_Widget() {
$widget_ops = array('classname' => 'ba-superwidget', 'description' => 'Shows social icons' );
$this->WP_Widget('BA_Template_Widget', 'SW - Template Widget', $widget_ops);
}
/* Change Tabtastic Tab Nav to a Heading like h5 */
/* Put code in Custom LESS/CSS Box in DMS Custom Tab */
/* Section FullTabs */
.section-fulltabs .nav a {
font-family: @headingsFontFamily; /* From DMS Typography Settings */
font-size: @h5Size; /* Grab heading size, can use @h1Size through @h6size */
font-weight: @headingsFontWeight; /* From DMS Typography Settings */
}