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
| add_filter( 'genesis_footer_backtotop_text', 'shireman_footer_backtotop_text' ); | |
| /** | |
| * Customize the return to top of page text | |
| * | |
| */ | |
| function shireman_footer_backtotop_text( $backtotop ) { | |
| $backtotop = '[footer_backtotop text="Return to Top"]'; | |
| return $backtotop; | |
| } |
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
| add_action( 'wp_enqueue_scripts', 'webendev_load_google_font' ); | |
| /** | |
| * Enqueue Google Fonts | |
| * | |
| * @author Greg Rickaby | |
| * @since 1.0 | |
| */ | |
| function webendev_load_google_font() { | |
| $protocol = is_ssl() ? 'https' : 'http'; |
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
| add_action( 'genesis_after_post_content', 'shireman_do_buyat_section', 5 ); | |
| /** | |
| * Add 'BUY AT' Section for Book URLs on Published Books CPT | |
| * | |
| */ | |
| function shireman_do_buyat_section() { | |
| if ( 'we_published-book' == get_post_type() ) { | |
| echo '<div id="buy-at">'; | |
| echo '<div class="buy-lead-in"><i class="icon-book"></i>BUY AT:'; |
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
| function shireman_books_header_loop( $args ) { | |
| global $post; | |
| $defaults = array( | |
| 'orderby' => 'rand', | |
| 'post_type' => 'we_published-book', | |
| 'posts_per_page' => 9, | |
| 'post_status' => 'publish', | |
| 'no_found_rows' => true, // counts posts, remove if pagination required | |
| 'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...) | |
| 'update_post_meta_cache' => false, // grabs post meta, remove if post meta required |
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
| unregister_sidebar( 'header-right' ); | |
| remove_action( 'genesis_header', 'genesis_do_header' ); | |
| add_action( 'genesis_header', 'webendev_do_new_header' ); | |
| /** | |
| * Replace Header to include Custom Logo and Unregister Header Right Sidebar | |
| * | |
| */ | |
| function webendev_do_new_header() { | |
| echo '<div id="site-logo"><a href="' . home_url() .'"><img src="' . get_stylesheet_directory_uri() . '/images/header_logo.png" alt="Site Logo" /></a>'; | |
| echo '</div><!-- end #site-logo -->'; |
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
| /* | |
| * Add classes to Genesis Navigation | |
| * | |
| */ | |
| add_filter( 'genesis_do_nav', 'webendev_override_do_nav', 10, 3 ); | |
| function webendev_override_do_nav($nav_output, $nav, $args) { | |
| $args['menu_id'] = 'the_id_you_want'; | |
| $args['menu_class'] = 'class1 class2'; // replace what was there | |
| $args['menu_class'] .= ' nav-bar'; // or append to it |
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
| /** | |
| * Patient Name Dynamic Population | |
| * | |
| */ | |
| add_filter('gform_field_value_patient_name', 'patient_name_population_function'); | |
| function patient_name_population_function($value){ | |
| $name = $_POST['input_20_10']; | |
| return $name; | |
| } |
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
| add_action( 'admin_init', 'webendev_restrict_admin_with_redirect', 1 ); | |
| /** | |
| * Restrict Access to WP Admin to Administrators Only | |
| * | |
| */ | |
| function webendev_restrict_admin_with_redirect() { | |
| if ( ! current_user_can( 'manage_options' ) && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' ) { | |
| wp_redirect( site_url() ); exit; | |
| } | |
| } |
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
| add_action( 'wp_before_admin_bar_render', 'webendev_remove_sitename' ); | |
| /** | |
| * Remove Site Name menu from WP Toolbar if not Admin | |
| * | |
| */ | |
| function webendev_remove_sitename() { | |
| if ( ! current_user_can( 'activate_plugins' ) ) { | |
| global $wp_admin_bar; | |
| $wp_admin_bar->remove_menu('site-name'); |
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
| add_filter( 'gform_pre_render_20', 'webendev_add_readonly_script' ); | |
| /** | |
| * Make Gravity Form Field Read Only (first page of multi-page or a single page) | |
| * | |
| */ | |
| function webendev_add_readonly_script($form){ | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function(){ |