View search.php
<?php | |
// check to see if there is a post type in the URL | |
if ( isset( $_GET['post_type'] ) && $_GET['post_type'] ) { | |
// save it for later | |
$post_type = $_GET['post_type']; | |
// check to see if a search template exists | |
if ( locate_template( 'search-' . $post_type . '.php' ) ) { |
View functions.php
<?php | |
add_action( 'init', 'kb_register_post_types' ); | |
function kb_register_post_types() { | |
register_post_type( 'kb_article', array( | |
'labels' => array( | |
'name' => 'Articles', | |
'singular_name' => 'Article', | |
'menu_name' => 'Knowledge Base', |
View mailchimp.html
<form action="[ACTION]" method="post" target="_blank"> | |
<input type="email" name="EMAIL" placeholder="Email…"> | |
<input type="text" name="[BLOCKER]" tabindex="-1" style="display: none;"> | |
<input type="submit" value="Subscribe"> | |
</form> |
View index.php
<a href="<?php echo WC()->cart->get_cart_url(); ?>"> | |
<span class="cart_totals"><?php echo WC()->cart->get_cart_total(); ?></span> | |
</a> |
View index.php
<?php if (sizeof(WC()->cart->get_cart()) != 0) : ?> | |
<a href="<?php echo WC()->cart->get_cart_url(); ?>"> | |
<span class="cart_totals"><?php echo WC()->cart->get_cart_total(); ?></span> | |
</a> | |
<?php endif; ?> |
View index.php
<a href="<?php echo WC()->cart->get_cart_url(); ?>"><?php echo WC()->cart->get_cart_total(); ?></a> |
View index.php
<a href="<?php echo WC()->cart->get_cart_url(); ?>">Cart</a> |
View functions.php
<?php | |
function my_nav_wrap() { | |
// checks if there is an item in the cart | |
// returns default items + cart link if there is | |
// returns default items if the cart is empty | |
if (sizeof(WC()->cart->get_cart()) != 0) { | |
$wrap = '<ul id="%1$s" class="%2$s">'; |
View functions.php
<?php | |
function my_nav_wrap() { | |
$wrap = '<ul id="%1$s" class="%2$s">'; | |
$wrap .= '%3$s'; | |
$wrap .= '<li class="cart">'; | |
$wrap .= '<a href="' . WC()->cart->get_cart_url() . '"> class="cart_totals">'; | |
$wrap .= WC()->cart->get_cart_total(); | |
$wrap .= '</a>'; | |
$wrap .= '</li>'; |
View functions.php
<?php | |
function my_nav_wrap() { | |
// default value of 'items_wrap' is <ul id="%1$s" class="%2$s">%3$s</ul>' | |
// open the <ul>, set 'menu_class' and 'menu_id' values | |
$wrap = '<ul id="%1$s" class="%2$s">'; | |
// get nav items as configured in /wp-admin/ | |
$wrap .= '%3$s'; |