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
<h1 class="u-margin-4 u-margin-2-lg">Dit is een tekst</h1> |
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 disable_admin_menu_pages() { | |
// Check if the plugin exists and is active | |
if ( class_exists( 'Woocommerce' ) && is_plugin_active( 'woocommerce/woocommerce.php' ) ) { | |
// Set a user capability to disable the menu pages. In this case the menu pages will be removed for all users who don't have the 'manage_options' capability. | |
if ( ! current_user_can( 'manage_options' ) ) { | |
remove_menu_page( 'woocommerce' ); // Remove the WooCommerce menu page | |
remove_menu_page( 'edit.php?post_type=product' ); // Remove the products menu page. | |
} | |
} | |
} |
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( | |
'cat' => set_your_id, | |
'posts_per_page' => set_your_posts_per_page_ex_5, | |
); | |
// Get the category object with properties | |
$category = get_category( $args['cat'] ); | |
// Define WP_Query withe the arguments | |
$query = new WP_Query( $args ); | |
?> |
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 | |
/* | |
Template Name: Whity Page | |
Show a different front page if the user is not logged in. In this case we use a white page without any content. | |
*/ | |
$frontpage_id = get_option( 'page_on_front' ); | |
$get_page_template = get_post_meta( $frontpage_id, '_wp_page_template', true ); | |
// Set template name (ex.page-whity.php); | |
$template_name = 'page-whity.php'; |
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
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_id' ); | |
get_option( 'woocommerce_view_order_page_id' ); | |
get_option( 'woocommerce_terms_page_id' ); |
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 wb_get_title( $before = '<h1>', $after = '</h1>' ) { | |
$title = NULL; | |
if ( is_page() || is_singular() || is_single() ) { | |
$title = get_the_title(); | |
} elseif ( is_archive() ) { | |
$title = $category_name = single_cat_title( '', false ); | |
} elseif ( is_post_type_archive() ) { | |
$obj = get_queried_object(); | |
$title = $obj->labels->name; | |
} elseif ( is_tax() ) { |