Hi, would anybody know what the file name must be for adding html code to a child theme. for example, must the file be custom.php or custom.js

function my_scripts_method() { wp_enqueue_script(       'custom-script',       get_stylesheet_directory_uri() . "/js/custom_script.js        array( 'query' ),'',true );           } add_action( 'wp_enqueue_scripts', 'my_custom_script.js' ); 

Ive tried putting this code in functions.php and header.php to call the javascript. doesn’t work

The countdown javascript animation is in a file named custom_script.js in a folder named js, which is in the child theme folder named wpbdemo. The animation also had css and html, but that is working I think, as the countdown template is showing, its just not doing any movement. So, I think its the javascript code not working. The css is in style.css file and the html is in footer.php.

Saving data from for loop to file and then read the data and plot graphs

I have a for loop which generates random matrices, then performs a few calculations to yield a bunch of different values. Essentially, something like so: For[j = 1, j < 100, j++, a={{1}{2}{3}{4}},b={{5}{6}{7}{8}},c=Tr[a],d=Tr[b], e=c+d, {a,b,c,d,e}>>> file]

Of course in the above, we repeat the same values over and over, I am using this as an example as the script would be too long and requires a list of different packages. I need to save these values to a file in a way that I can then extract the values and create a bunch of different graphs. What is the best way to go about this?

Cannot write to file with fopen() , Permission denied

I get failed to open stream: Permission denied when trying to create a file, or write to a file (if I manually create it first in FTP or SSH).

I’ve looked at many aspects but I don’t find what may be the issue. So maybe it could related to wordpress in some way. The wordress setup is based on Bedrock (with a different folder structure).

Here are the details:

I do an ajax call from the frontend, which reaches a method in the backend, inside a plugin script. The method is an ajax function which is registered with a "wp_ajax_nopriv" action.

Folder path: This script is in /mnt/persist/www/thesite.com/web/app/plugins/theplugin/src/

Owner: The "src" folder and all its parent folders have a certain user, "deploy" as owner.

Permissions: All folders have 755. The file: If I create it manually, I have set it to ‘775’ and deploy as owner.

Current user: If I do get_current_user() inside the ajax method, I get "deploy".

Working directory: If I run getcwd() inside the script however, the working directory turns out to be: /mnt/persist/www/thesite.com/web/wp/wp-admin.

I changed permissions in "src" to 777.

I use "fopen" like this:

$  fp = fopen( $  folderPath . $  filename . '.txt' ,"a" );        if(!$  fp){     die('Error: ' . implode(',',error_get_last())); } 

If I try to create/write to a file in the current directory (not using a folder path), it doesn’t work, and if I try to use the path: /mnt/persist/www/thesite.com/web/app/plugins/theplugin/src/ (which is verified with file_exists), plus the filename, it gives the same Permission denied error.

If I SSH into the server and change user to deploy, and go into "src" folder, I can create a file with "touch myfile.txt".

Concerning the working directory ( /mnt/persist/www/thesite.com/web/wp/wp-admin) , those folders also have "deploy" as the owner, and permissions set to 755.

Can I trust get_current_user(), which says deploy? I thought I might be running it as www-data, but since it says deploy, there shouldn’t be any problem?

I’m a bit clueless..

Unqueue css file from specific page

I’m trying to unqueue style.css file from a specific page.

In my functions.php (child theme) if I add:

add_action( 'wp_enqueue_scripts', 'apc_child_desregistra_estilos', 11 ); function apc_child_desregistra_estilos() {     wp_dequeue_style( 'main-styles' ); } 

It works.

But when I add something like:

if (is_front_page()): wp_dequeue_style( 'main-styles' ); endif; 

It doesn’t.

I really don’t know what I am doing wrong.

how to exclude images from scrset based on file size (kb)

when I upload optimized jpg images to WordPress, I encounter the following problem: The original image file size is smaller than the auto-generated images (for the 1st and sometimes even the 2nd "smaller" auto-generated size).

Example: Original Image File: example.jpg (77kb, 816 * 612px)

Auto-generated Files: example-768×576.jpg (112kB), example-600×450.jpg (76kB)

anything I can do about this? The resulting problem is scrset, it doesn´t make any sense to deliver a scaled down image to the user if the file size is bigger or equal to the original file! Is there a functionality to "teach" scrset to pay attention to the file size as well?

-thanks in advance!

wp-blog-header.php): failed to open stream: No such file or directory in /home/

Need help with current error below. WP website is down and cannot even login to WP-admin. Anyone available to help resolve problem?

Warning: require(/home/mdvince/public_html/wp-blog-header.php): failed to open stream: No such file or directory in /home/mdvince/public_html/index.php on line 17

Fatal error: require(): Failed opening required ‘/home/mdvince/public_html/wp-blog-header.php’ (include_path=’.:/opt/alt/php74/usr/share/pear’) in /home/mdvince/public_html/index.php on line 17