Skip to content

Instantly share code, notes, and snippets.

@mantismamita
mantismamita / cta-row.json
Last active August 29, 2015 14:27
acf module for row of CTA boxes with icons and links
[
{
"key": "group_55490c0964f25",
"title": "CTA-boxes",
"fields": [
{
"key": "field_55490d5e86a78",
"label": "CTA Box Row",
"name": "cta_box_row",
"type": "repeater",
@mantismamita
mantismamita / progress.json
Last active August 29, 2015 14:27
Progress row module
[
{
"key": "group_55c65ddbd14ea",
"title": "Progress Module",
"fields": [
{
"key": "field_55c66f980c854",
"label": "Progress Title",
"name": "progress_title",
"type": "text",
@mantismamita
mantismamita / background.php
Last active May 1, 2023 20:40
custom background
function _mytheme_custom_background_cb() {
$is_big = (wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' )[0]) ? true : false;
if( has_post_thumbnail() && $is_big ){
$background= wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' )[0];
$background_lg = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' )[0];
$background_med = wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium' )[0];
$color = 'dddddd';
} else {
@mantismamita
mantismamita / sorting.js
Created May 15, 2015 12:02
jQuery filtering function
jQuery("#sorting li:first-child").addClass('active');
jQuery('#sorting li').click(function() {
// Remove the current active class
// Add the active class to the clicked button
jQuery('#sorting li.active').removeClass('active');
jQuery(this).addClass('active');
// Get the button text (filter value)
var filterValue = jQuery(this).data('sort');
@mantismamita
mantismamita / wpcloudy1.php
Last active August 29, 2015 14:19
lines 672-673 and 854-862
// for 672-673 this might work better:
add_action('save_post','wpc_save_metabox');
function wpc_save_metabox($post_id){
if ( 'wpc-weather' === $get_post_type($post_id)) {
//do stuff...
}
@mantismamita
mantismamita / ricg.php
Last active November 20, 2015 11:23
flexslider with ACF and RICG plugin for WordPress
$images = get_field('slides');
if( $images ) : ?>
<div id="slider" class="flexslider">
<ul class="slides">
<?php foreach( $images as $image ): ?>
<?php if(function_exists('tevkori_get_srcset_array')){ ?>
@mantismamita
mantismamita / new_gist_file.php
Created April 8, 2015 18:26
flexslider markup in WordPress (uses ACF)
$images = get_field('slides');
if( $images ) { ?>
<div id="slider" class="flexslider">
<ul class="slides">
<?php foreach( $images as $image ): ?>
<li>
<img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
</li>
<?php endforeach; ?>
@mantismamita
mantismamita / functions.php
Created March 25, 2015 13:52
Force SSL for media library
function have_https_for_media( $url ) {
if ( is_ssl() )
$url = str_replace( 'http://', 'https://', $url );
return $url;
}
add_filter( 'wp_get_attachment_url', 'have_https_for_media' );
@mantismamita
mantismamita / new_gist_file_0
Created January 14, 2015 09:05
image replacement
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
.ninja-forms-form-wrap .ninja-forms-all-fields-wrap{
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
color: #333333;
label{
font-weight: normal;
}
h2{
display: none;
}
.ninja-forms-required-items{