Forum in maintenance, we will back soon 🙂
I just checked your code and it seem you changed the URLs right, now make sure that you have uploaded an image to WordPress with the same link as the one you wrote in the javascript code.
@husein Unfortunately all my attempts failed THIS a sample of what i replace in javascript
imageContainer.innerHTML = '<img src="https://habibart.com/wp-content/uploads/2024/03/robot.jpg" alt="Error" style="max-width: 100%;">'
i change all of them with robot.jpg
is something wrong with my edit please help!
@habibart do you have an uploaded picture on WordPress named robot.jpg ?
@husein well if @habibart does then it isn't in the uploads/2024/03 folder. give a 404 error.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
do you think I was supposed to download a GIF instead of a JPG
I GOT it! thank you guys for the help I switched the image jpg to a gif and it worked
@habibart it doesn't have to do with GIF versus JPG, the issue was that the robots.jpg file didn't exist. You uploaded another set of files and the folder now moved from 2024/03 to 2024/04. See https://habibart.com/wp-content/uploads/2024/04/ for the list of files.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor in the code there is gif not jpg that's why when I switched to gif it worked.
now I am encountering another error when I try to add a new code snippet where I changed the API key and the prompt but every time I click save this error came up
Snippet has not been activated due to an error plz help!
Please click the back button in the browser to update the snippet.
Error message:
Cannot redeclare setApiKey() (previously declared in /home/www9834/domains/habibart.com/public_html/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(292) : eval()'d code:3)
@habibart I guess this error is beacuse you have the same function name in different code snippets, try changing its name.
@habibart you must use different function names in the new snippets. Be sure to change the names for where you use the function as well or you will get the result from the original function.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
@ssadvisor I thought i did countless times but I get the same error
function setPrompt($input) {
return "Generate 5 catchy blog titles for a blog post about " . $input;
changed the function to generate 5 catchy YouTube video titles but still get the same error
am I doing it wrong please help
@habibart the duplicate function name is setApiKey(). Actually if the results for this one are the same then you can simply remove the def from you new snippet and it will return the same value.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
Thanks Hasan, i created my ai blog title generator, modify the prompt a bit here
i can now create many tools i desire in ths line of script. thanks God bless
pls membership plugin works with mycred that is free to use so i can give my user free credit to test
@webideasnetwork, please show me an example of what you did to create many tool like copy and paste the parts you changed in the script code thank you
@ssadvisor is this the part I should change when I try to add a new snippet and if yes which part thank you!
$api_key = setApiKey();
$api_url = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=' . $api_key ;
finally got it!
for all who still encounter the same problem you just need to change all the functions in the code for my case I added the letter G to all the functions function like setApiKey becomes function setGApiKey and do the same with all the functions in the code
thank you and good luck!!!