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 | |
| /** | |
| * Theme initialization | |
| * | |
| * @package KnowTheCode\Developers | |
| * @since 1.0.0 | |
| * @author hellofromTonya | |
| * @link https://knowthecode.io | |
| * @license GNU General Public License 2.0+ | |
| */ |
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_entry', 'genesis_prev_next_post_nav', 9 ); | |
| add_action( 'genesis_before_while', 'genesis_sample_loop_setup' ); | |
| /** | |
| * Setup the loop. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @return void | |
| */ |
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_entry', 'explore_event_registry_table', 1 ); | |
| /** | |
| * Let's look at the event registry table for `genesis_after_entry` | |
| * to discover what callbacks are pre-registered to it and in what order. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @return void | |
| */ | |
| function explore_event_registry_table() { |
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
| //remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); | |
| //add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 7 ); | |
| add_action( 'genesis_after_entry', 'genesis_do_author_box_single', 11 ); | |
| remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 ); | |
| add_action( 'genesis_after_entry', 'ktc_show_event_table', 1 ); | |
| /** | |
| * Let's look inside of the event registry table for the event name | |
| * 'genesis_after_entry'. `$wp_filter` is the global variable for |
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_post_permalink', 'genesis_sample_change_post_permalink' ); | |
| /** | |
| * Change the post permalink by prefixing with an indicator as to what it is. | |
| * | |
| * @since 1.0.0 | |
| * | |
| * @param string $html | |
| * | |
| * @return string | |
| */ |
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 genesis_do_post_image() { | |
| if ( is_singular() || ! genesis_get_option( 'content_archive_thumbnail' ) ) { | |
| return; | |
| } | |
| $img = genesis_get_image( array( | |
| 'format' => 'html', | |
| 'size' => genesis_get_option( 'image_size' ), | |
| 'context' => 'archive', |
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 genesis_do_post_image() { | |
| /** | |
| * Return Early Pattern opportunity | |
| * ================================ | |
| * Notice that the code wrapped in this conditional block only executes IF the | |
| * conditional expression is true. Hum, that means if the conditional expression | |
| * is false, then the function is done and nothing else is going to happen. | |
| */ | |
| if ( ! is_singular() && genesis_get_option( 'content_archive_thumbnail' ) ) { |
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 genesis_header_body_classes( array $classes ) { | |
| if ( current_theme_supports( 'custom-header' ) ) { | |
| if ( get_theme_support( 'custom-header', 'default-text-color' ) !== get_header_textcolor() || get_theme_support( 'custom-header', 'default-image' ) !== get_header_image() ) | |
| $classes[] = 'custom-header'; | |
| } | |
| if ( 'image' === genesis_get_option( 'blog_title' ) || ( get_header_image() && ! display_header_text() ) ) | |
| $classes[] = 'header-image'; |
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 | |
| namespace KnowTheCode; | |
| add_filter( 'authenticate', __NAMESPACE__ . '\enable_login_with_email', 20, 3 ); | |
| /** | |
| * Allow the user to log in via email address. | |
| * | |
| * If the `$email_or_username` parameter is not an email, then bail out, returning the `$user`. | |
| * Otherwise, get the user's object via the email. Then reauthenticate their login | |
| * via `wp_authenticate_username_password`. |