<?php $conditions = array( 'is_home()', 'is_front_page()', '$wp_query->is_posts_page', 'is_page()', 'is_single()', 'is_singular()', 'is_attachment()', 'is_search()', 'is_archive()', 'is_category()', 'is_tag()', 'is_tax()', 'is_author()', 'is_day()', 'is_month()', 'is_year()', 'is_time()', 'is_date()', 'is_paged()', 'is_comments_popup()', 'is_preview()', 'is_404()', ); echo '<h2>Conditional Tag</h2><ul>'; $i = 0; foreach ( $conditions as $condition ) : $condition = str_replace('()', '', $conditions[$i]); switch ( $condition ) : case 'is_front_page' : $query = is_front_page(); break; case '$wp_query->is_posts_page' : $query = $wp_query->is_posts_page; break; default : $query = $wp_query->$condition; break; endswitch; echo '<li><code>' . $conditions[$i] . '</code>'; echo $query ? ': <span style="color:green">true</span>' : ': <span style="color:red">false</span>'; echo '</li>'; $i++; endforeach; echo '</ul>'; ?>
Monthly Archives: February 2014
An image make center form every side
.Absolute-Center {
margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; }
.parent_div{position: relative; height:200px; width:200px;}
Implement CSS on All common classes
[class*=”col-“] {}
Display woo commerce Reviews on any other Place
woocommerce_template_product_review() {
woocommerce_get_template( ‘single-product/tabs/tabs.php’ );
}
add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_product_review’, 20 );
Update Default Jquery of WP
function modify_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js', false, '1.8.1'); wp_enqueue_script('jquery'); } } add_action('init', 'modify_jquery');
Fetch All menu item
<?php
$menus = get_terms(‘nav_menu’);
foreach($menus as $menu){
echo $menu->name . ” _all”;
} ?>