Example snippet (a stripped down version):
add_action( 'wc_before_payment_method_label' , 'add_payment_gateway_fee_label', 10, 1 );
function add_payment_gateway_fee_label( $id ) {
if( $id == "paypal" ){
echo '<span class="custom-gateway-label paypal">' . $id . '</span>';
}
elseif( $id == "cod" ){
echo '<span class="custom-gateway-label cod">' . $id . '</span>';
}
elseif( $id == "bacs" ){
echo '<span class="custom-gateway-label bacs">' . $id . '</span>';
}
else {
echo '<span class="custom-gateway-label free">' . "free" . '</span>';
}
}
Am I missing something? How can I run these snippets?
]]>I’m having a problem with a website: https://itjobsco.com/
If you scroll down a bit you would see “Latest Jobs”, “Latest Resumes” and “Latest Companies” tabs. The problem is, the content of all tabs is shown.
To compare: the template preview is here: https://alexgurghis.com/themes/wpjobus/
The JavaScript and CSS is completely unchanged, as well as classes and ids of the divs.
On localhost, it works fine, also I compared the code and it’s all same (JavaScript and CSS).
What I did yesterday, was trying to render-block JavaScript (PageSpeed results are weak for this site and for template even more). I tried a bunch of plugins but all on localhost and since none of them helped (after every plugin absolutely none JavaScript loaded on the site) I did not install any of them in the published site.
Finally, following a tutorial, I put a class in functions.php and made a custom handler to add async to wanted scripts.
Everything was fine, but at the end of the day, when I logged out of wordpress, no JavaScript loaded. That’s the first weird thing since what difference does it make if I’m logged in or not. So I undid all changes to functions.php in both localhost and published site.
I also wrote async to a couple of scripts in header.php but also reverted.
I really don’t know where to look. It is really weird that only those tabs are affected. Even on localhost I can see as it is loading to be the way as it is in the published site, but then at the end the content of the other two tabs disappears, but in the published site those functions (.hide() to hide the tabs content and .show() to show the first tab’s content) just don’t execute. As I looked for solutions I wondered if it might be multiple jQuery instances somewhere but in that case why other JavaScript on the page isn’t affected.
As I said, it shouldn’t be plugins because on the published site, I did not install any.
Any suggestions would be appreciated.
Thanks
]]>nginx.conf
# Generic startup file.
user nginx nginx;
#usually equal to number of CPUs you have. run command "grep processor /proc/cpuinfo | wc -l" to find it
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Keeps the logs free of messages about not being able to bind().
# daemon off;
events {
worker_connections 1024;
}
http {
# rewrite_log on;
include mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
# tcp_nopush on;
keepalive_timeout 3;
# tcp_nodelay on;
# gzip on;
#php max upload limit cannot be larger than this
client_max_body_size 64m;
index index.php index.html index.htm;
# Upstream to abstract backend connection(s) for PHP.
upstream php {
#this should match value of "listen" directive in php-fpm pool
server unix:/var/run/php-fpm/php-fpm.sock;
# server 127.0.0.1:9000;
}
# include sites-enabled/*;
include /etc/nginx/conf.d/*.conf;
}
phpmyadmin.conf (works)
server {
listen 80;
server_name 192.168.1.215;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location /db-sector {
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/pma_pass;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
}
wordpress.conf (doesn’t work, downloads index.php)
server {
listen 80;
server_name 192.168.1.215;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}
if you need any specifics let me know.
]]>Exec-PHP is great… wondering if wordpress itself is going to integrate this functionality permanately without the plugin in future version release maybe 3.0???
]]>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
——–
That’s what I get every time I try to execute a plugin. I have tried to chmod the file and directory to 777, no luck. Suggestions? AIM would be best, DHermit202
]]>