-
EricJohnsonGuru
Example: https://morehubbub.com/action-buttons/
My clients really want the add as google trusted source and for the AI prompt buttons. What I am not sure about is the ability to pass through the base domain url or the current url.
Example add site as trusted source: https://www.google.com/preferences/source?q=generate.support
-
Hi there,
I’m not familiar with the things you asked, unfortunately!
Do you have the instructions on how to construct the button?
-
EricJohnsonGuru
I’m wondering if I can have buttons where the URL changes based on what page it is on. I know there are some dynamic properties but I did not see an option for the page url to be appended to the link. So the chatgpt url always stays the same but I need the page URL sanitized and added to the end.
Example:
https://chatgpt.com?q= + ‘your prompt here’ + TheCurrentPageURL
-
Alvind
Hi there,
One method is to create a custom dynamic tag that returns the current page URL. You can add this snippet:
add_action('init', function () { if (!class_exists('GenerateBlocks_Register_Dynamic_Tag')) { return; } new GenerateBlocks_Register_Dynamic_Tag([ 'title' => __('Current URL', 'generatepress'), 'tag' => 'current_url', 'type' => 'post', 'supports' => [], 'description' => __('Returns the current page URL.', 'generatepress'), 'return' => function ($options, $block, $instance) { global $wp; $output = home_url(add_query_arg([], $wp->request)); return GenerateBlocks_Dynamic_Tag_Callbacks::output($output, $options, $instance); }, ]); });Adding PHP: https://docs.generatepress.com/article/adding-php/
This will create a {{current_url}} tag that outputs the current page URL. To use it, simply append the dynamic tag to your URL like this:
https://chatgpt.com?q= + “your prompt here” + {{current_url}}
Let me know if that works!
- You must be logged in to reply to this topic.