Skip to content

Instantly share code, notes, and snippets.

@csknk
csknk / social-sharing.css
Created November 15, 2013 16:39
Social Sharing for Thesis 2.1 Hook
/*Social Sharing Button Styles*/
.btn a {
color:#fff;
text-decoration: none;
}
.btn {
display: inline-block;
font-size: .882352941em;
padding: .4em .666666667em;
line-height: 1.333333333;
@csknk
csknk / social_sharing.css
Created November 15, 2013 16:40
CSS for social sharing
/*Social Sharing Button Styles*/
.btn a {
color:#fff;
text-decoration: none;
}
.btn {
display: inline-block;
font-size: .882352941em;
padding: .4em .666666667em;
line-height: 1.333333333;
@csknk
csknk / author_link_byline
Created November 26, 2013 13:08
Insert blog post author with link to author website on Thesis 2.1 hook
@csknk
csknk / related_projects
Created November 26, 2013 15:14
Display related posts - set manually by means of ACF. This gist is for a Thesis 2.1 hook.
@csknk
csknk / add_images
Created November 26, 2013 16:14
Add images from ACF repeater field, Thesis 2.1
/***ADD PROJECT IMAGES****/
function add_project_images() {
if(get_field('project_images')):
while(has_sub_field('project_images')): ?>
<img class="project_images" src ="<?php echo get_sub_field('p_images'); ?>"title=""><?php
@csknk
csknk / featured_image_hook
Created November 26, 2013 17:35
Display Featured image caption on a Thesis 2.1 hook
/****IMAGE ATTRIBUTION****/
function add_image_attribution() {
if (get_field('copyright_holder')!= "") { // only runs if the copyright holder field is populated
?><div class="attribution">
<?php if (get_field('image_source')!= "") { // next line runs if there is data in the image source field - giving a url to link to
@csknk
csknk / enqueue scripts thesis 2
Created November 27, 2013 13:05
Enqueue scripts in Thesis 2.1 (scripts in js folder under active skin)
add_action( 'wp_enqueue_scripts', 'carawebs_load_javascript_files' );
function carawebs_load_javascript_files() {
wp_register_script( 'mixitup_script', THESIS_USER_SKIN_URL . '/js/jquery.mixitup.min.js', array( 'jquery' ), null, true);
wp_register_script( 'carawebs_scripts', THESIS_USER_SKIN_URL . '/js/dgym_scripts.js', array( 'jquery' ), null, true);
wp_enqueue_script('mixitup_script');
wp_enqueue_script('carawebs_scripts');
@csknk
csknk / add_related_projects.php
Last active December 29, 2015 16:19
Add related projects with headings,excerpt & featured image. Hooked into Thesis 2.1. Related projects selected by ACF.
@csknk
csknk / display tags if present
Created December 5, 2013 10:59
Display tags for the post if they are present.
<?php
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
echo $tag->name . ' ';
}
}
?>