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
| $url = "https://v3.openstates.org/jurisdictions'; | |
| $args = array( | |
| 'headers' => array ( | |
| 'X-API-KEY' => 'your api key here' | |
| ), | |
| ); | |
| $response = wp_remote_get( $url, $args ); | |
| $response_code = wp_remote_retrieve_response_code( $response ); | |
| if ( 200 != $response_code ) { |
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 | |
| add_shortcode( 'my_filter', function ( $atts ) { | |
| ob_start(); | |
| ?> | |
| <form method="get"> | |
| <select name="category_name"> | |
| <option value="name1">Name1</option> | |
| <option value="name2">Name2</option> | |
| </select> | |
| <input type="submit" value="Filter"> |
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
| /** | |
| * Filter to modify the returned data from Display Eventbrite | |
| * to take the day of the start date and apply it to teh end of teh last day of | |
| * multi day events | |
| * | |
| * So the event appears as a single bookable entry in calendar layouts | |
| * | |
| */ | |
| add_filter( | |
| 'wfea_api_results', // hook to filter returned event data before display |
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
| <head> | |
| <style> | |
| .vfx-slideshow { | |
| position: relative; | |
| } | |
| .vfx-slideshow > div:not(:first-child) { | |
| display:none; | |
| } | |
| .vfx-slideshow > div { |
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
| // wfea_slide_count set externally | |
| // wfea_slide_speed milliseconds set externally | |
| (function ($) { | |
| function specific_slide(num) { | |
| while ( num != counter ) { | |
| counter++; | |
| if (counter > wfea_slide_count ) { | |
| counter = 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
| <?php | |
| // this should be in top template I think | |
| enqueue_script('wfea-slideshow-script'); | |
| $speed=apply_filters('wfea_slideshow_speed', $speed); | |
| $script_vars = 'var wfea_slider_speed = ' . $speed . ';' . | |
| 'var wfea_slider_count = ' . $data->atts['limit'] . ';'; | |
| wp_add_inline_script( 'wfea-slideshow-script', $script_vars, 'before' ); | |
| ?> | |
| <div class="wfea-slides" style="position: absolute;top: 0;left: 0;bottom: 0; right: 0;"> // style in CSS? |
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
| var isIE = window.document.documentMode ? true : false; | |
| if ( isIE ) { | |
| window.location.replace("https://my-site/new-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
| .help-tip { | |
| position: absolute; | |
| text-align: center; | |
| background-color: #409EBB; | |
| border-radius: 50%; | |
| width: 15px; | |
| height: 15px; | |
| font-size: 12px; | |
| line-height: 17px; | |
| cursor: default; |
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
| $gravity_view_frontend = \GravityView_frontend::getInstance(); | |
| remove_filter('the_title', [$gravity_view_frontend, 'single_entry_title'], 1, 2); |
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
| /* code to check if logged in to a different WP site example.com */ | |
| $logged_in_cookie = 'wordpress_logged_in_' . md5( 'https://example.com' ); | |
| if ( ! isset($_COOKIE[ $logged_in_cookie ]) ) { | |
| // display adverts | |
| } | |