This file contains 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 // image gallery content | |
if( has_shortcode( $post->post_content, 'gallery' ) ) { | |
// Grab the first gallery in the post | |
$gallery = get_post_gallery_images( $post->ID ); | |
$image_list = '<div class="owl-carousel">'; | |
// Loop through each image in each gallery | |
foreach( $gallery as $image ) { |
This file contains 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 radio image customize control extends the WP_Customize_Control class. This class allows | |
* developers to create a list of image radio inputs. | |
* | |
* Note, the `$choices` array is slightly different than normal and should be in the form of | |
* `array( | |
* $value => array( 'url' => $image_url, 'label' => $text_label ), | |
* $value => array( 'url' => $image_url, 'label' => $text_label ), | |
* )` |
This file contains 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 | |
class WidgetWithBehaviorScript extends WP_Widget { | |
function __construct() { | |
parent::__construct(__CLASS__, 'Widget with Accompanying Behavior Script', array( | |
'classname' => __CLASS__, | |
'description' => "This WordPress widget serves as a pattern for how to enqueue a script only if the widget is actually rendered." | |
)); | |
NewerOlder