I’ve successfully used the snippet plugin to add text snippets to my site, but when I try to add a javascript snippet, it just shows the shortcode [snippetname] on my site.
I created a new snippet with the name “reward” and the following content:
add_action( 'wp_head', function () { ?>
<script>
const euro = 3.03;
document.write(euro);
</script>
<?php } );
and tried including it on the page by simply writing [reward]
. It’s probably a newbie mistake, but I couldn’t find a solution on this forum.
Allow Auto Run to (x) Yes, I want to run my Pipes in both manually and automatically methods.
and
Cronjob Active to (x) No, I will create a cronjob task myself to run the script https://localhost:8096/wp/?pipes=cron&task=callaio.
When visiting that script URL (as the cronjob task should), first only {ogb-res:0}
is shown, then {ogb-res:1}
for a moment and then {ogb-res:0}
again.
The pipe (there is only one currently) isn’t executed because the posts are not created, in contrast to executing the pipe in test mode where the posts are created.
Thanks!
]]>I get this annoying error in my console logs : “grecaptcha.execute is not a function”.
(I’m in Contact Form 7 v5.1.4 but I think it appeared before)
When I click on the error, I see the error comes from wp-content/plugins/contact-form-7/modules/recaptcha.php, line 78.
I’ve searched on the web for nearly an hour, when I came here: https://developers.google.com/recaptcha/docs/v3
From that page, it seems like the code lacks the “grecaptcha.ready” part in order to work properly.
I added it before the call to grecaptcha.execute in the code, and now the error seems to be gone.
I’m creating this topic because I guess other people have/will have the same issue as me, and also to know if there is a better solution (or if this is even a solution).
I’m afraid that this “fix” will be overwritten when I update Contact Form 7 next time…
Thanks!
]]>I would like to be able to execute a php code in my Text widgets. For example on one site I have made a function for my own little youtube video gallery and I would like to display it in the text widget like: “<php my_function_video_gallery(); ?>”.
Plus I would like to do it without a plugin (have tried https://www.ads-software.com/plugins/php-code-widget/ and that works). I have found several tutorials for this:
https://firstsiteguide.com/run-php-code-text-widget-wordpress/
https://wordpress.stackexchange.com/questions/215463/how-to-run-php-code-in-text-widget-with-no-plugin-in-wp-4-4
https://www.emanueleferonato.com/2011/04/11/executing-php-inside-a-wordpress-widget-without-any-plugin/
https://www.wpstuffs.com/how-to-execute-php-code-in-text-widget-without-using-plugin/
…
As you can see, they are all pretty much the same and I understand what the code is trying to do. Unfortunately it does not work. The Text Widget does not execute php command…
Here are some screenshots. Here I am trying to use a custom function for displaying dummy ad, but that is not really important. Point is, I want to be able to use php in Text widget…
This is my functions.php: https://drive.google.com/file/d/15pjZqwVV6TUoBoNOe7G_aLawSkiMwgYK/view?usp=sharing
This is my widget area:
https://drive.google.com/file/d/1Wzi0owshfQycykPi1ZY0sq3TaJKNGyYK/view?usp=sharing
On the site it just displays (no execution…):
https://drive.google.com/file/d/185i3_dxDx17p3KCUJoyG5GWWzMGGOWod/view?usp=sharing
<a href="application/x-Research-Info-Systems;charset=utf-8,TY%20%20-%20BOOK%0ATI%20%20-%20Test %0AAU%20%20-%20Follesdal %2C%20Andreas%0AY1%20%20-%202016%2F%2F%2F%0APB%20%20-%20Entelequia%20y%20Grupo%20Eumed.net%20(Universidad%20de%20M%C3%A1laga)%0AAB%20%20-%20This%20is%20a%20test.%0AER%20%20-%20"> [Cite RIS/EndNote]</a>
]]>How can I go about doing that?
Thanks guys, your help is highly appreciated.
The Countdown Code:
<script type = "text/javascript">
var timeInSecs;
var ticker;
function startTimer(secs) {
timeInSecs = parseInt(secs);
ticker = setInterval("tick()", 1000);
}
function tick( ) {
var secs = timeInSecs;
if (secs > 0) {
timeInSecs--;
}
else {
clearInterval(ticker);
startTimer(172800); // start again
}
var hours= Math.floor(secs/3600);
secs %= 3600;
var mins = Math.floor(secs/60);
secs %= 60;
var pretty = ( (hours < 10 ) ? "0" : "" ) + hours + ":" + ( (mins < 10) ? "0" : "" ) + mins + ":" + ( (secs < 10) ? "0" : "" ) + secs;
document.getElementById("countdown").innerHTML = pretty;
}
startTimer(172800); // 48 hours in seconds
The code I need to run after the 48 hours has passed then reset as per above:
What I want to do:
1. Insert shortcode in ticker
2. shortcode connects to database und pulls a string
3. the string should now be visible in the ticker-output
I want to do this, because I dont want to insert all the content by hand and want it to be stored in a database.
Thank you for your support
https://www.ads-software.com/plugins/ditty-news-ticker/
]]>