Replace li Items with divs with classes

Ok, I found a way that works great for me here 🙂 <?php $customPostTaxonomies = get_object_taxonomies(‘short_courses’); if(count($customPostTaxonomies) > 0) { foreach($customPostTaxonomies as $tax) { $args = array( ‘orderby’ => ‘name’, ‘show_count’ => 0, ‘pad_counts’ => 0, ‘hierarchical’ => 1, ‘taxonomy’ => $tax, ‘title_li’ => ”, ‘hide_empty’ => FALSE ); $categories = get_categories( $args ); foreach … Read more

Display custom fields on post excerpt or teaser

The way to retreive some meta data is knowing the name of the custom field, for my example I will use: listing, property and address; normally this can be done after while (have_posts()) : the_post(); $listing = get_post_meta($post->ID, ‘listing’, true); $property = get_post_meta($post->ID, ‘property’, true); $address = get_post_meta($post->ID, ‘address’, true); then you can print the … Read more

I have 2 post types i need to show the post type contents in 2 select boxes [closed]

Below Code will generate Select box of post type “resources” change this value as per your post type. <select name=”page_id” id=”page_id” class=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””>Select Resource Post</option> <?php global $post; $args = array( ‘numberposts’ => -1,’post_type’=>’resources’); $posts = get_posts($args); foreach( $posts as $post ) : setup_postdata($post); ?> <option value=”<? echo get_permalink($post->ID); ?>”><?php the_title(); ?></option> <?php … Read more

How to display product subcategories into my custom post type single page

Using wp_list_pluck to return an array in the form of array(term_id => parent, …), you can do the following (explanation is given in the comments): $variations = get_the_terms( the_ID() , ‘product_cat’ ); if(is_array($variations)) { //make sure terms were returned $parents = wp_list_pluck( $variations, ‘parent’, ‘term_id’ ); foreach ($variations as $variation) { if($variation->parent && $parents[$variation->parent] && … Read more