How to create a ‘single’ category widget for woocommerce plugin [closed]

A bit late but perhaps this might still help someone… If you don’t mind hardcoding the parent category name, slug and ID (e.g. “All”, “designer”,”38″) this works for creating a dropdown to jump to child categories of the specified ID: <?php $terms = get_terms( ‘product_cat’, ‘child_of=38’ ); if ( $terms ) { print( ‘<select name=”product_cat” … Read more

Custom Permalink Plugin and Current Page/Ancestor in Menus

You could add classes to wp_nav_menu via the nav_menu_css_class filter: function wpa83498_nav_class( $classes, $item ){ // if Shop is the current menu item being output // and we’re viewing a single product post type if( ‘Shop’ == $item->title && is_singular( ‘product’ ) ) $classes[] = ‘current-page-ancestor’; return $classes; } add_filter( ‘nav_menu_css_class’, ‘wpa83498_nav_class’, 10, 2 ); … Read more

Execute js files doesn’t seem to work

Just hook to wp_enqueue_scripts for both registering and enqueueing. You’ve registered with in_footer (last parameter in your code) true so what you need is: function print_my_royal_slider_script() { global $add_my_script; if ( ! $add_my_script ) return; wp_enqueue_script(‘my-script’); } add_action (‘wp_enqueue_scripts’, ‘print_my_royal_slider_script’); The problem is going to be with $add_my_script. That has to be set before wp_head … Read more

Embed plugin into Custom Page Template

I think you need something is_page() to output the page content: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_content(); ?> <?php endwhile; else: ?> <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p> <?php endif; ?> further reading about shortcodes http://wp.smashingmagazine.com/2012/05/01/wordpress-shortcodes-complete-guide/