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 | |
| $args = array( | |
| 'post_type' => array( 'post' ), | |
| 'post_status' => array( 'publish' ), | |
| 'posts_per_page' => 100, // don't use -1, pick something reasonable | |
| 'no_found_rows' => true, // useful when pagination is not needed. | |
| 'update_post_meta_cache' => false, // useful when post meta will not be utilized. | |
| 'update_post_term_cache' => false, // useful when taxonomy terms will not be utilized. | |
| // 'ignore_sticky_posts' => true, // ignore sticky posts |
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 the page has a gravity form. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param int $id Post or page id, default to false. | |
| * | |
| * @return boolean | |
| */ |
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 ( ! function_exists( 'plugin_do_action' ) ) { | |
| function plugin_do_action( $filter, $modifiers ) { | |
| if ( ! is_array( $modifiers ) ) { | |
| $modifiers = array( $modifiers ); | |
| } | |
| // add an empty modifier so the base filter will be applied as well | |
| array_unshift( $modifiers, '' ); |
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
| .ui-datepicker { | |
| background-color: #fff; | |
| border: 1px solid #66AFE9; | |
| border-radius: 4px; | |
| box-shadow: 0 0 8px rgba(102,175,233,.6); | |
| display: none; | |
| margin-top: 4px; | |
| padding: 10px; | |
| width: 240px; | |
| } |
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(function( $ ){ | |
| // Sets the horizontal location of the lines | |
| $(document).ready(function () { | |
| var entryHeaderWidth = $('.entry-title').width(); | |
| var titleWidth = $('.entry-title .title').width(); | |
| $('.entry-title span.before').css("right", entryHeaderWidth/2+titleWidth/2 ); | |
| $('.entry-title span.after').css("left", entryHeaderWidth/2+titleWidth/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
| <?php | |
| /** | |
| * Add a parallax image behind a page entry header in genesis. | |
| * | |
| * @author Joshua David Nelson, [email protected] | |
| */ | |
| // Parallax Image | |
| add_action( 'genesis_header', 'parallax_image', 15 ); | |
| /** |
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 | |
| /** | |
| * Correct method for WordPress 4.3 | |
| * @see https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/ | |
| * @see http://codex.wordpress.org/Widgets_API | |
| */ | |
| class My_Widget extends WP_Widget { | |
| /** | |
| * Sets up the widgets name etc |
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 posts exist in a post type. | |
| * | |
| * @author Joshua David Nelson, [email protected] | |
| * | |
| * @param string $post_type The post type slug (required). | |
| * @param | |
| */ | |
| function posts_exist( $post_type, $post_status = 'publish' ) { |
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_action( 'wp_head', 'remove_feeds_from_wp_head', 1 ); | |
| /** | |
| * Remove feed links from wp_head | |
| */ | |
| function remove_feeds_from_wp_head() { | |
| // Remove feed links | |
| remove_action( 'wp_head', 'feed_links', 2 ); | |
| remove_action( 'wp_head', 'feed_links_extra', 3 ); |
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 custom metabox to Genesis CPT Archive Settings. | |
| * | |
| * @author Joshua David Nelson, [email protected] | |
| * | |
| * @link https://joshuadnelson.com/adding-metaboxes-to-genesis-cpt-archive-settings | |
| */ | |
| class JDN_Genesis_CPT_Archive_Settings { | |