Skip Navigation

[Resuelto] Custom Shortcode for Taxonomy Name

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 hace 6 años, 1 mes. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Etiquetado: ,

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Tom Gonzales hace 6 años, 1 mes.

Asistido por: Minesh.

Autor
Mensajes
#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: enlace oculto

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:

enlace oculto

And here is a link to documentation on the plugin:

enlace oculto

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

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Well - your shortcode were not correct.

I've added another shortcode at the following location:
=> enlace oculto

And I can see it's working just fine:
=> enlace oculto

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!