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
<!-- // The HTML (could be part of page content) // --> | |
<input type="text" name="keyword" id="keyword" onkeyup="fetch()"></input> | |
<div id="datafetch">Search results will appear here</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
//* Enqueue Scripts | |
add_action( 'wp_enqueue_scripts', 'custom_load_scripts' ); | |
function custom_load_scripts() { | |
wp_enqueue_script( 'shrinking-header', get_bloginfo( 'stylesheet_directory' ) . '/js/shrinking-header.js', array( 'jquery' ), '1.0.0', true ); | |
} |
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
/* Stop non-admins from accessing the dashboard. | |
Instead, they're redirected to a custom page, | |
which stops them from messing with the website. | |
This is the url. I've added an extra page to the site_url() */ | |
$goodbye = site_url() .'/video/videos'; | |
function acme_login_redirect( $redirect_to, $request, $user ) { | |
return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : $goodbye; | |
} | |
add_filter( 'login_redirect', 'acme_login_redirect', 10, 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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
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
/**** Truly Force Layout without allowing the User to Override the preferred/recommended layout ****/ | |
// Force Full Width Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); | |
// Force Content-Sidebar Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); | |
// Force Sidebar-Content Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content' ); |