Skip Navigation

[Resolved] Adding Email to URL of Toolset Button Block + 404 Error

This support ticket is created 3 years, 10 months ago. 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by JoelK2744 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1968337

Hello,

I have a view which I would like to add a button to that has a mailto link to an email address stored as a custom field. I am using the button block, if I choose dynamic button URL it doesn't give the email address as an option (it only shows fields stored as a URL). I have also tried adding [types field="my-email-address-field"][/types] as the URL but it doesn't work.

Also, whenever I add a Toolset button I get an error in Inspector - "Failed to load resource: the server responded with a status of 404 ()" - for .../wp-includes/css/dashicons.css?ver=5.6.2 - I'm not using dashicons or any icons at all with these buttons. The error is there because our WP installations are in a sub directory, I've tried adding an a different url under advanced but the error always reappears. Is there any way of dequeuing this or preventing the search for dashicons?

Thanks

#1968475

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joel,

Thank you for getting in touch.

Unfortunately you won't be able to construct a mailto link using the Toolset Button option. In order to achieve your goal you will need to manually make the button by constructing the link and then using CSS to style it as a button.

Here is an example of how to construct the link

<a  id='email-me' href="mailto:[types field='my-email' output='raw'][/types]"> Email Me </a>

Notice i've given it an id called email-me, you will need to use this id to style the link as a button. For reference on this you can take a look a the link below.
hidden link

Thanks,
Shane

#1968535

Thanks Shane, I'll give that a go. Any suggestions regarding the dashicons issue?

Thanks

#1971131

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joel,

You can try using the code below to dequeue the dashicons.

add_action( 'wp_print_styles',     'my_deregister_styles', 100 );

function my_deregister_styles()    { 
   //wp_deregister_style( 'amethyst-dashicons-style' ); 
   wp_deregister_style( 'dashicons' ); 
}

Please try this and let me know if this 404 error still remains.

Thanks,
Shane

#1971315

Thanks Shane, that didn't work for me unfortunately (it seemed to remove the dashboard admin bar) but I've found another solution using a script manager.

Thanks