This file contains 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
public function add_meta_box() { | |
global $pagenow; | |
if( in_array( $pagenow, array( 'post.php' ) ) ) { | |
// Display only if post is published | |
add_meta_box( | |
); | |
} | |
} |
This file contains 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 | |
function is_child( $page_id ) { | |
$child_check = get_post_ancestors( $page_id ); | |
if($child_check) { | |
return true; | |
} | |
} |
This file contains 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
//* Set the default WooCommerce front-end styles | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) { | |
add_action( 'admin_init', 'woocommerce_default_frontend_styles' ); | |
} | |
/** | |
* Define default WooCommerce frontend styles | |
*/ |
This file contains 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
if ( is_user_logged_in() ) { | |
get_template_part( 'home', 'loggedin' ); | |
} else { | |
get_template_part( 'home', 'notloggedin' ); | |
} |
This file contains 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 post has content | |
if ($post->post_content == '') { | |
//* Content if post is empty | |
} | |
//* Alternate | |
if (get_post()->post_content == '') { | |
//* Content if post is empty |
This file contains 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 | |
/* | |
* The page you would like to display the slider. This can be a page template or a single-{post-type}.php template | |
* Must be a page that you can attach images to. | |
* | |
*/ | |
//* Enqueue the scripts for this page only | |
add_action( 'wp_enqueue_scripts', 'exodus_attachment_slider_scripts' ); |
This file contains 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 support for the Attachment Slider | |
add_theme_support( 'attachment-slider', 'defined_image_size' ); |
This file contains 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
//* Login screen register link filter | |
add_filter( 'register', 'custom_register_url' ); | |
function custom_register_url() { | |
return '<a href="http://yourcustomlink.com">Register</a>'; | |
} |
This file contains 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 | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
$roles = $wp_roles->get_names(); | |
foreach ($roles as $role_value => $role_name) { | |
echo '<p><input type="checkbox" value="' . $role_value . '">'.$role_name.'</p>'; |
This file contains 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
//* Declare WooCommerce Support | |
add_theme_support( 'woocommerce' ); |