Skip to content

Instantly share code, notes, and snippets.

@csknk
csknk / ACF Repeater UL
Created January 31, 2014 15:59
ACF Repeater Field Data as a UL
/* Add repeater field data as UL */
function carawebs_repeater_ul() {
if(get_field('repeater_field')): ?>
<h3>Heading if Necessary</h3>
<ul>
<?php while(has_sub_field('repeater_field')): ?>
jQuery(document).ready(function($) {
$("body").backstretch([BackStretchImg.src],{duration:3000,fade:750});
});
@csknk
csknk / Add to custom.php
Last active August 29, 2015 13:56
Set up Masonry jQuery plugin for Thesis 2.x
/*======================================================================
* jQuery Masonry
* ===================================================================*/
/* Add Masonry and link to masonry control script file into footer */
function cw_enqueue_masonry() {
// Run on the front page (static page) only
if (is_front_page()) {
# Find and remove files
# cd to parent directory
find . -name *-460x260.* | xargs rm -f
function carawebs_image_attribution() {
// Variables:
$name = get_field('attr_name'); // Text field
$name_url = get_field('attr_url'); // Text field
$permission = get_field('permission'); // True False field
// Build a variable namelink if a URL has been specified
if ($name_url!="") {
$namelink = "<a href='" . $name_url ."'> $name</a>";
@csknk
csknk / ie8 ul indent
Last active August 29, 2015 13:56
Indent text ul & ol ie8
/*Indent uls so that text wraps and aligns below the text rather than the bullet*/
/*IE8 and lower specific code - class ie8 added */
.ie8 .post_box ul {
margin-left: 15px;
padding-right: 15px;
padding-left:10px;
line-height:25px;
list-style: square;
}
@csknk
csknk / dash-bullets
Created February 10, 2014 12:43
Dashes as bullets
/** use dashes as bullet characters**/
.post_box ul {
list-style:none;
margin-left:0;
padding-left:1em;
}
.post_box ul li:before {
display:inline-block;
content:"–";
width:1em;
@csknk
csknk / dash-bullet
Created February 10, 2014 14:58
Dash bullet points with indented 2nd line
/* use dashes as bullet characters for ul and indent second line properly for ul */
ul.dash {
list-style:none;
margin-left:20px;
padding-left:10px;
}
ul.dash li:before {
display:inline-block;
@csknk
csknk / Output Tweets
Last active August 29, 2015 13:56
Output tweets using StormUK's PHP class
/* Front Page Twitter */
function carawebs_frontpage_twitter() {
?><h2 class="twitter_headline"><a href="http://twitter.com/XXX">@TWITTER_HANDLE</a></h2>
<div class="shortbox"><?php
$tweets = getTweets(TWITTER_HANDLE_NO@, 1); // Twitter handle, number of tweets to display
if(is_array($tweets)){
/*Search*/
/* Initial State */
#search_container {
width: 140px;
height: 20px;
float: right;
}