Skip Navigation

[Gelöst] Custom Shortcode for Taxonomy Name

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:
Custom Shortcode for Taxonomy Name

Solution:
You need custom shortcode in order to display taxonomy name from eventon plugin.

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/custom-shortcode-for-taxonomy-name/#post-1120696

Relevant Documentation:

This support ticket is created vor 5 Jahre, 5 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Tom Gonzales vor 5 Jahre, 5 Monate.

Assisted by: Minesh.

Author
Artikel
#1120078

I am trying to: Create a custom shortcode to pull a taxonomy name into a View loop. Minesh recently helped me by correcting a shortcode to pull in term-meta data for location address, but when I tried modifying the code in a new shortcode to pull the event location/venue name, it's not working.

Link to a page where the issue can be seen: hidden link

I expected to see: I created the following shortcode, based on a previous shortcode used to pull in term-meta data for the location address (which Minesh previously helped me with - thanks!), but it's not working, so I was hoping Minesh could take a look and point me in the right direction:

// Get Location Name
function location_name_func( $atts ) {
global $post;

$term_ids = wp_get_object_terms( $post->ID, 'event_location', array( "fields" => "ids" ) );
if(is_array($term_ids)) {
$location_name=evo_get_term_meta($tax, $term_id);
return $location_name['location_name'];
}

}
add_shortcode( 'show_location_name', 'location_name_func' );

Instead, I got: Here's are the results I'm getting so far:

hidden link

And here is a link to documentation on the plugin:

hidden link

I already set up access via an admin account for Minesh, which is still active.

Any help would be much appreciated.

#1120181

I've also tried this version of coding to create the shortcode, but it's not working either:

// Get Location Name
function func_get_taxonomy_name( $atts ) {
global $post;

$term_ids = wp_get_object_terms( $post->ID, 'event_location', array( "fields" => "ids" ) );
if(is_array($term_id)) {
// $locations = get_term_meta($term_ids[0]);
$locations=evo_get_term_meta($tax, $term_ids[0]);
return $locations['$tax'];
}

}
add_shortcode( 'show_location_name', 'func_get_taxonomy_name' );

And I tried inserting the taxonomy using the Fields and View button in the Views admin panel and selecting the Event Location option under the taxonomy section and selected it to display the name, but that doesn't work either.

#1120696

Minesh
Supporter

Languages: Englisch (English )

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

Well - your shortcode were not correct.

I've added another shortcode at the following location:
=> hidden link

And I can see it's working just fine:
=> hidden link

Could you please confirm.

#1120965

My issue is resolved now. And BTW...you guys provide some of the best support for paid WordPress software solutions. Thank you!

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