Add to page template
<div id="post-container">
/* Post titles will be inserted here */
</div>
<button id="load-more">Load More</button>
| if (version_compare(PHP_VERSION, '6.0.0') >= 0) { | |
| echo 'I am at least PHP version 6.0.0, my version: ' . PHP_VERSION . "\n"; | |
| } | |
| if (version_compare(PHP_VERSION, '5.3.0') >= 0) { | |
| echo 'I am at least PHP version 5.3.0, my version: ' . PHP_VERSION . "\n"; | |
| } | |
| if (version_compare(PHP_VERSION, '5.0.0', '>=')) { | |
| echo 'I am using PHP 5, my version: ' . PHP_VERSION . "\n"; |
| $(window).scroll(function() { | |
| var top_of_element = $("#my_element").offset().top; | |
| var bottom_of_element = $("#my_element").offset().top + $("#my_element").outerHeight(); | |
| var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); | |
| var top_of_screen = $(window).scrollTop(); | |
| if ((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)){ | |
| // element is in view, do something | |
| } else { | |
| // element is out of view, do something else |
| <?php /* | |
| Board of Directors. | |
| Template usage: <?php echo do_shortcode('[board_of_directors]'); ?> | |
| Editor usage: Add a shortcode: [board_of_directors] | |
| */ | |
| function board_of_directors_code() { | |
| if( have_rows('directors', 19) ) { | |
| while( have_rows('directors', 19) ) : the_row(); |
| <?php | |
| $current_version = '1.4.0'; | |
| $required_version = '3.9.2'; | |
| if (version_compare($current_version, $required_version) < 0) { | |
| // Do something | |
| } | |
| ?> |
| if( $('.finished-auctions').is(':checked') ) { | |
| // Do something | |
| } |
| /* Add body class to admin */ | |
| add_filter( 'admin_body_class', 'my_body_class' ); | |
| function my_body_class( $class ) { | |
| $class .= ' stormbox-plugin '; | |
| return $class; | |
| } |
| <?php /* | |
| Shortcode CTA button for use in the editor. | |
| Example usage: | |
| [button href="https://www.google.com.au" target="_blank"]Visit Google[/button] | |
| */ | |
| function button( $atts, $content = null ) { | |
| $a = shortcode_atts( array( | |
| 'class' => 'button-link external', | |
| 'href' => '#', |
| $( document ).ready(function() { | |
| var width = $('iframe').width(); | |
| $('iframe').css({ | |
| 'width': width, | |
| 'height': width*(9/16) | |
| }); | |
| }); |
| /* Additional user profile fields */ | |
| function extra_profile_details( $methods ) { | |
| $methods['new_email'] = __( "New email", "wproject" ); | |
| return $methods; | |
| } | |
| add_filter('user_contactmethods','extra_profile_details',10,1); |