Support » Plugin: Custom Post Carousels with Owl » Display Taxonomy Terms

  • Resolved Joelle

    (@joelle)


    Hello! Thanks for much for this plugin, it does like 99% of what I need, but I’m hoping you can help in this one area. Is it possible to show the taxonomy terms underneath the title instead of an excerpt or a ‘read more’ or whatever?

    To give context, we’re carouseling books: book covers with the book title (custom post type) and the book author underneath (custom taxonomy). And then the genre of book beneath that (another custom taxonomy).

    Is that possible at all? It would be incredibly helpful, probably to others as well who may want to show such a thing. I know this is a free plugin, so I appreciate any assistance you can provide. 🙂

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author thehowarde

    (@thehowarde)

    Hi @joelle … The way to do this would be to exclude all of the content on the setting page for that particular carousel, and then use the hooks to drop the content you want in there. I can try to write some code for you, or you can just look at https://wordpress.org/plugins/dd-post-carousel/#are%20there%20programming%20hooks%3F in the meantime.

    Thread Starter Joelle

    (@joelle)

    Hi @thehowarde! Thanks so much. Yes, I saw those hooks and wasn’t immediately sure if that would do the trick, but I will look at it further. If you have time to share some code, I’d welcome the opportunity to learn from it. If not, that’s okay, too. Thanks!

    Plugin Author thehowarde

    (@thehowarde)

    Hi @joelle

    See if this points you in the right direction… This works on a WooCommerce product and with product categories.

    
    add_action( 'dd-carousel-after-content' , 'my_custom_carousel_header' , 10, 1);
    function my_custom_carousel_header($id){
    	if ($id == 2267) { // your carousel ID - numeric
    	     global $post;
    	     echo '<a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a><br>';
                 $terms = get_the_terms($post->ID, 'product_cat'); // use your custom taxonomy
                 $term_list = array();
                 foreach ($terms as $term){
                     $term_list[] = $term->name;
                 }
            echo implode(', ', $term_list);
         }
    }
    

    If you need more help… I think you have my email.

    • This reply was modified 7 months, 3 weeks ago by thehowarde. Reason: fix formatting
    Thread Starter Joelle

    (@joelle)

    Thank you, Howard! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display Taxonomy Terms’ is closed to new replies.