Skip Navigation

[Resolved] Display Taxonomy Name At Top Of Archive

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 5 replies, has 3 voices.

Last updated by rubenB 9 years ago.

Assisted by: Minesh.

Author
Posts
#296485

I am trying to: display the taxonomy name at the top of a custom taxonomy archive.

Instead, I got: It is naturally blank. I tried using a variety of inserted shortcodes but none of them pulled up the proper taxonomy.

Here is my code as it is.

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
          <div id="chefindex">
<wpv-loop>
     <div id="chefname">[wpv-post-title]</div>
[types field="photo" width="250" align="right" resize="proportional"][/types]
          <div id="archivetypes">[wpv-view name="private-chef"]
            [wpv-view name="yacht-chef"]</div>
  <div id="chefdata">
  <strong>Availability</strong>: [wpv-post-taxonomy type="availability" separator=", " format="text" show="name" order="asc"]<br><br>
  <strong>Locations</strong>: [wpv-post-taxonomy type="location" separator=", " format="text" show="name" order="asc"]
  </div>
          <a href="[wpv-post-url]">Read the full chef profile</a>
          </wpv-loop>
                      </div>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]<strong>No posts found</strong>[/wpml-string]
	[/wpv-no-items-found]
[wpv-layout-end]
#296672

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

=> Could you please send me few screenshots where exactly you want to display your taxonomy name at top and at which portion of the page?
=> Which taxonomy name you want to display?
=> A link where I can see your issue will be helpful.

Also, Please send me the setup explaining your CPT, taxonomies, veiws etc..etc..

#296782
taxonomy-archive.jpg

The taxonomy hierarchy is for my CPT "Chef":

Chef Types
-Private Chef
-Yacht Chef

And both of those have sub-children beneath them.

I've attached a screenshot. There is only one test item in my taxonomy archive, but I basically would like the taxonomy name ("Private Chef") on top of the archive. I want to use the taxonomy archive template for both Private Chef and Yacht Chef, though I know I can create a separate version for each and hard-code the taxonomy name at the very top. I was just hoping to single-source them to the same archive template so if I made changes, I'd only have to do it once.

Unfortunately, the beta site is in a protected view so I can't give you a URL. Let me know if you need more information.

#297139

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I think you should create a custom shortcode:

Please try following shortcode:
1) add below codes in your theme functions.php:

add_shortcode('wpv-archive-title', 'wpv_archive_title_func');
function wpv_archive_title_func($atts, $content){
    return get_the_archive_title();
}

2) use the shortcode [wpv-archive-title] in your WordPress archive

#297465

That works! Thanks!

#479087

Thanks! Solved my problem too.

I just did the same thing for archive descriptions, as both
[wpv-post-taxonomy type="level" format="name"] &
[wpv-post-taxonomy type="level" format="description"]
was buggy when posts belonged to several taxonomies at once.

/* Do similar thing for archive descriptions */

function custom_get_archive_description( $atts ){
	return get_the_archive_description();
}
add_shortcode( 'wpv-archive-description', 'custom_get_archive_description' );

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.