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
| jQuery(window).load(function() { | |
| var $allVideos = jQuery("iframe[src^='http://www.youtube.com']"); //Find all embedded iframes from YouTube and load them into an array | |
| var $fluidElement = jQuery("Fluid_Width_Element").width(); | |
| $allVideos.each(function() { | |
| jQuery(this).data('aspectRatio', this.height / this.width).removeAttr('height').removeAttr('width'); //Find the aspect ratio, store it, and remove the height and width attributes | |
| var $aspectRatio = jQuery(this).data('aspectRatio'); | |
| jQuery(this).width($fluidElement).height($fluidElement * $aspectRatio); //Change the height and width of each iframe to fit the container | |
| }) | |
| jQuery(window).resize(function() { | |
| var $newWidth = $fluidElement; //When the window is resized, store the new width |
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 | |
| $url = "$URL_of_feed"; | |
| $rss = simplexml_load_file($url); | |
| $items = $rss->channel->item; | |
| $count = 0; | |
| if($rss) { | |
| foreach($items as $item) { | |
| if($count <= 1) { | |
| $title = $item->title; | |
| $description = $item->description; |
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
| //Wordpress | |
| /*functions.php | |
| Input this function into the functions.php file to call when a dropdown is needed*/ | |
| function custom_taxonomy_dropdown( $taxonomy, $orderby = 'slug', $order = 'ASC', $limit = '-1', $name, $show_option_all = null, $show_option_none = null ) { | |
| $args = array( | |
| 'orderby' => $orderby, | |
| 'order' => $order, | |
| ); |
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 | |
| $response = wp_remote_get( '$API_URL' ); | |
| if( is_wp_error( $response ) ) { | |
| echo 'Something went wrong!'; | |
| } else { | |
| echo 'Response:<pre>'; | |
| print_r( $response ); | |
| echo '</pre>'; | |
| } |
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
| $(document).ready(function() { | |
| var imgArr = new Array ( | |
| <?php | |
| $total = count(get_field('field')); | |
| $count = 1; | |
| while(the_repeater_field('field', $pagenumber)): ?> | |
| '<?php the_sub_field('sub_field'); ?>'<?php if($count < $total){echo ',';} $count++; ?> | |
| <?php endwhile; ?> | |
| ); | |
| var n = 0; |