This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template used for displaying a CTA block. | |
* | |
* @package _s | |
*/ | |
// Set up fields. | |
$title = get_sub_field( 'title' ); | |
$text = get_sub_field( 'text' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( have_rows('testimonials') ): | |
echo '<div id="testimonials" class="carousel slide" data-ride="carousel" data-pause="false">'; | |
echo '<div class="carousel-inner">'; | |
$count = 1; | |
while( have_rows('testimonials') ): the_row(); | |
$testimonial = get_sub_field('testimonial_text'); | |
$author = get_sub_field('testimonial_author'); | |
echo '<div class="carousel-item text-center py-5'; | |
if ( $count == 1 ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To fetch the list of all registered blocks in the JS, we can do something like this: | |
wp.blocks.getBlockTypes() // in browser console. | |
// Also, to get a list of blocks for a particular namespace, you may use something like this: | |
wp.blocks.getBlockTypes().filter((block) => { return block.name.indexOf('core') !== -1}); | |
// (This will list all blocks with namespace 'core' | |
// https://gist.github.com/DavidPeralvarez/37c8c148f890d946fadb2c25589baf00#gistcomment-3658460 | |
------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "../variables/_spacing.css"; | |
/* | |
* SPACING UTILITIES | |
* | |
* Utilities for setting padding and margin. | |
* | |
* Legend: | |
* | |
* Rules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param WP_Query|null $wp_query | |
* @param bool $echo | |
* @param array $params | |
* | |
* @return string|null | |
* | |
* Accepts a WP_Query instance to build pagination (for custom wp_query()), | |
* or nothing to use the current global $wp_query (eg: taxonomy term page) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change the columns for the releases list screen | |
function change_columns( $cols ) { | |
$cols = array( | |
'cb' => '<input type="checkbox" />', | |
'featimg' => 'Featured Image', | |
'excerpt' => 'Excerpt?', | |
'title' => 'Title', | |
'artist' => 'Artist', | |
'catno' => 'Cat#', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//check if form was sent | |
if($_POST){ | |
$to = '[email protected]'; | |
$subject = 'Testing HoneyPot'; | |
$header = "From: $name <$name>"; | |
$name = $_POST['name']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: My Custom Shortcodes | |
* Plugin URI: https://wordpress.org/plugins/my-custom-shortcodes/ | |
* Description: Custom shortcode for plugin development talk | |
* Version: 1.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* Author: Jeffrey Carandang | |
* Author URI: https://jeffreycarandang.com/ |