Title: Displaying category inside title
Last modified: January 21, 2020

---

# Displaying category inside title

 *  Resolved [labyrinth207](https://wordpress.org/support/users/labyrinth207/)
 * (@labyrinth207)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/displaying-category-inside-title/)
 * I had created 3 categories, Buy, Sell, and Swap within the classifieds.
 * Now I want to display the category inside the title using the [adverts_list]
   (
   see [https://prnt.sc/qqj6un](https://prnt.sc/qqj6un)) while translating the category
   name
 * Buy -> Looking for [Item Title]
    Sell -> Selling [Item Title] Swap -> Swap for[
   Item Title]
 * I had done some experiments but unable to achieve the desired result
    Your help
   is deeply appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Greg Winiarski](https://wordpress.org/support/users/gwin/)
 * (@gwin)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/displaying-category-inside-title/#post-12347417)
 * You can display category name after the title by adding the code below in your
   theme functions.php file
 *     ```
       add_action( "adverts_list_after_title", "my_adverts_list_after_title" );
       function my_adverts_list_after_title( $post_id ) {
           $advert_category = get_the_terms( $post_id, 'advert_category' );
           if( empty( $advert_category ) ) {
               return;
           }
           echo '<span style="display:inline-block;">';
           foreach($advert_category as $c) {
               echo join( " / ", advert_category_path( $c ) );
           }
           echo '</span>';
       }
       ```
   
 *  Thread Starter [labyrinth207](https://wordpress.org/support/users/labyrinth207/)
 * (@labyrinth207)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/displaying-category-inside-title/#post-12355588)
 * Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Displaying category inside title’ is closed to new replies.

 * ![](https://ps.w.org/wpadverts/assets/icon-256x256.png?rev=2423472)
 * [WPAdverts - Classifieds Plugin](https://wordpress.org/plugins/wpadverts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpadverts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpadverts/)
 * [Active Topics](https://wordpress.org/support/plugin/wpadverts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpadverts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpadverts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [labyrinth207](https://wordpress.org/support/users/labyrinth207/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/displaying-category-inside-title/#post-12355588)
 * Status: resolved