Second level subcategory

Found the solution! 🙂 $taxonomies = array(CUSTOM_CAT_TYPE); foreach($taxonomies as $tax) { $args = array( ‘orderby’ => ‘name’, ‘show_count’ => 1, ‘pad_counts’ => 1, ‘hierarchical’ => 1, ‘hide_empty’ => 0, ‘taxonomy’ => $tax, ); wp_dropdown_categories( $args ); } Thanks for helping out!

woocommerce stored variable

There is $woocommerce, which is is crucial. Several classes stored into this, see woocommerce class reference and additionally WC API Docs. If you’re looking for product information: $product = get_product( $post->ID ); is certainly a good entry point. If you’re already on a product page or generally in the wc loop, you often have $product … Read more

wp_query inside the_loop

You can also try with following code: $featured = new WP_Query( array( ‘category_name’ => $category, ‘posts_per_page’ => 3 ) ); // The Loop if ( $featured->have_posts() ) { echo ‘<ul>’; while ( $featured->have_posts() ) { $featured->the_post(); echo ‘<li>’; echo ‘<div id=”title”>’ . get_the_title() .'</div>’; echo ‘<div id=”content”>’ . get_the_content() .'</div>’; echo ‘</li>’; } echo ‘</ul>’; … Read more

Move sticky posts down in main loop

You have to change the order in $wp_query->posts. Compare it to the values from get_option( ‘sticky_posts’ ). Example: function move_stickies_down( $num = 1 ) { global $wp_query; if ( empty ( $wp_query->posts ) ) return; $stickies = get_option( ‘sticky_posts’ ); if ( empty ( $stickies ) ) return; $sticky_posts = $top = $after = array(); … Read more

How do I restart my loop with get_next_post()?

get_next_post doesn’t really know what the “beginning” is. get_next_post uses get_adjacent_posts. If you look at the source, you can see that that function runs its own query to determine the next (or previous) post relative to the current post. It doesn’t loop through a list. To get the “first” post, you will need to run … Read more

How To Get Posts With A Specific Word

What you’ve described is just a search for the words “Dolph Ziggler”. You can use WP_Query as such $query = new WP_Query( ‘s=keyword’ ); Note, that you’ll probably want to cache those queries as they’ll be very slow.