Skip to content

Instantly share code, notes, and snippets.

View bacalj's full-sized avatar
🤔

Joseph Bacal bacalj

🤔
View GitHub Profile
@bacalj
bacalj / moondo.md
Last active February 8, 2024 20:24
Getting a local Moodle running with Lando
<?php
/*
Plugin Name: Post Edit Reminder
Description: Allows admin to add a customizable post-it-like reminder to Post Edit screen. Requires Advanced Custom Fields
Author: Joe Bacal
Version: 0.1
*/
function postreminder_text_after_title( $post_type ) {
$message = get_field('post_reminder_text', 'option');
@bacalj
bacalj / add-link-to-featured-image.php
Last active July 14, 2018 16:20
Filtering post_thumbnail_html - wrap it with a link to image src so image plugins pay attention
@bacalj
bacalj / display-posts-shortcode-helpers.css
Created July 14, 2018 16:40
Create the typical image-on-the-left and stuff-on-the-right layout using display posts shortcode
/*
if using this plugin: https://github.com/billerickson/display-posts-shortcode
and you write this shortcode:
[display-posts include_excerpt="true" excerpt_length="32" wrapper="div" wrapper_class="smith-layout" image_size="thumbnail" excerpt_more_link="true" excerpt_more="... Continue Reading"]
the below would work.
*/
@bacalj
bacalj / catdesc.php
Created July 14, 2018 17:42
display the category description on top of the category archive if the theme doesn't already
<?php
function add_cat_desc( $query ){
if (is_category()){
the_archive_description( '<div class="taxonomy-description">', '</div>' );
}
}
add_action( 'loop_start', 'add_cat_desc' );
@bacalj
bacalj / catgrido.php
Last active July 14, 2018 17:50
Shortcode to display a an array of category images that link to posts, will need your CSS to be helpful, you will also need a plugin that associates images to categories, like wp term images: https://wordpress.org/plugins/wp-term-images/
<?php
<?php
/*
Plugin Name: List Category Links with Pictures
Description: Shortcode to load an unstyled list of Taxonomy Term Links, Depends WP Term Images plugin: https://wordpress.org/plugins/wp-term-images/
Author: Joe Bacal, Smith College ETS
*/
//shortcode function
@bacalj
bacalj / Home.vue
Last active November 30, 2018 21:21
The .vue file doing all the work in the ger project
<template>
<div class="label-rendering-app" :class="{ 'zoomed': zoomed, 'half': !zoomed }">
<div v-if="!ishome">
<div class="img-wrap wrap" id="theimgwrap">
<img id="theimage" ref="iz"
:src="imgsArray[this.currentImgIndex].url"
:alt="imgsArray[this.currentImgIndex].alt"
@click="zoomToggle"
:class="{ zoomed : zoomed, landscape : imgsArray[this.currentImgIndex].landscape }"
@bacalj
bacalj / name_coach_api_request_examples.js
Last active June 17, 2024 07:08
Example ajax calls that work with NameCoach API V4
var ncapi = 'https://www.name-coach.com/api/private/v4/';
/*
generate and fill in an API token from your NameCoach admin
*/
var token = '';
/*
You will need to fill in an email address of a person in your NameCoach database.
Then, given the participant's email, get their data.
@bacalj
bacalj / card.php
Created March 26, 2019 15:50
facet wp template code for outputting posts as foundation cards
<div class="cards-container">
<?php while ( have_posts() ): the_post(); ?>
<div class="card">
<?php the_post_thumbnail(); ?>
<div class="card-content">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<?php
$tags = get_the_tags();
if ($tags){
foreach ($tags as $tag) {
@bacalj
bacalj / table.php
Created March 26, 2019 15:55
FacetWP template for foundation based theme to output a table of posts
<table cellpadding="0" cellspacing="0" width="100%">
<tbody width="100%">
<?php while ( have_posts() ): the_post(); ?>
<tr>
<td style="width:25%">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</td>
<td style="width:25%">
<?php