Tell us what you are trying to do?
I have a custom post type called Site Details. I have phone number and email address custom fields assigned to Site Details. I created one Site Details post as a way of storing site wide details for a business. The idea is that I add shortcuts throughout the site that use the phone numbers and email addresses in that post to display the data throughout the site. So if a client changes the phone number, they do it once in that post and the changes are reflected everywhere. I'm not sure how other people do that but that's the only way I can think of doing it at the moment. Please tell me if there's an easier way using Toolset.
So I have the fields filled in and using for example: [types field='email-address' post_id='179'][/types] I can display the data in a button or a text field successfully. I can't seem to do that in a menu or even in an Elementor Navigation Menu set to custom, even though there are options to use shortcodes and it's the shortcodes options inside Elementor that work everywhere else. I've tried all sorts of combinations of things but I just can't get the clickable 'email' word in the menu to correctly pull the data from the post's custom field.
Is there a way of doing this? I would have thought many businesses would want a phone number in a menu and if I can't get it done dynamically I'd be surprised. I would have thought it's a common thing to want to do.
Is there any documentation that you are following? No
Is there a similar example that we can see? Click the hamburger on the right hand side of the page under the telephone icon (another test menu) and click the 'phone' menu item once the hamburger has been clicked.
lien caché
If you click the phone number icon on the right in the link below (a site I finished last week) you'll be able to click on the UK, INT and WhatsApp links to dial the numbers and bring up a WhatsApp page but these only work because I entered tel:07967555555 for example in a standard WP menu custom link and this is no good to my client who will need to ask me to change the phone number each time manually. I am hoping a dynamic solution can be found from using Toolset custom field data.
lien caché
Hello and thank you for contacting the Toolset support.
I am not familiar with Elementor Navigation Menus, but if you are talking about a regular WordPress menu, I'll suggest using this 3rd party plugin and put the shortcode in the desired menus:
https://wordpress.org/plugins/shortcode-in-menus/
Or you can use the shortcode in a custom code that is hooked to wp_nav_menu_items or wp_nav_menu_{$menu->slug}_items with the do_shortcode function
- https://developer.wordpress.org/reference/hooks/wp_nav_menu_items/
- https://developer.wordpress.org/reference/hooks/ wp_nav_menu_menu-slug_items/
- https://developer.wordpress.org/reference/functions/do_shortcode/
I hope this helps. Let me know if you have any questions.
My issue is resolved now. Thank you!