
-
AuthorPosts
-
January 15, 2021 at 7:44 am #1272598
Hi!!
I have a problem, I don’t see images in the media library when the child theme is active. And when I want to insert an image in a page the image selector does not open.
if I activate the parent theme I can see the images.
Please, you don’t update the plugin Calendar
Thank you,
Maite-
This topic was modified 4 years, 6 months ago by
fusionweb.
January 15, 2021 at 8:36 am #1272613Hi Maite,
Thanks for giving us admin and FTP access.
I would suggest a troubleshooting step you can do to find out which file in your child theme is causing the issue (make sure any caching is off)
Do these steps in your child theme:
1. Change all the file extensions of the PHP files (except for functions.php) to .bup (for example footer.php to footer.bup) then check if the images show up.
2. If it gets fixed, follow 2a, if not follow 2b.
2a. Try to change the file extension back to .php, do this one by one, and check to know which one is causing the issue.
2b. Comment out all of the codes in functions.php and check.
3. If it gets fixed, uncomment each block of code to know which one is causing the issue.
Hope this helps.Best regards,
NikkoJanuary 15, 2021 at 11:06 am #1272657Hi!!
The problem is this code in function.php:
add_action(‘init’, ‘register_script’);
-
This reply was modified 4 years, 6 months ago by
fusionweb.
January 15, 2021 at 11:54 am #1272676Hi fusionweb,
We’re glad that you found the cause of the issue. :)
Let us know if you need further assistance.Best regards,
NikkoJanuary 15, 2021 at 2:56 pm #1272744Hi!
That line of code gives an error but I don’t know why, if I leave it commented, is there a problem?
Maite
January 17, 2021 at 5:09 am #1273002Hi Maite,
Yes, please try to post here the content of function register_script
Best regards,
NikkoJanuary 18, 2021 at 6:58 pm #1273411Hi!!
This is the code:
function register_script() {
global $wp_query;wp_enqueue_script( ‘ajax_js’, get_stylesheet_directory_uri() . ‘/js/ajax.js’, array( ‘jquery’ ), ‘1.0’, true);
wp_localize_script( ‘ajax_js’, ‘ajaxpagination’, array(
‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ),
‘query_vars’ => json_encode( $wp_query->query )
));
}January 19, 2021 at 5:14 am #1273552Hi fusionweb,
Thanks for pointing it out.
I have uncommented this code:add_action('init', 'register_script');
Then commented some code in ajax.js and it worked properly, so I put all your js code inside a self-invoking function:
(function () { // your code is inside here })();
And it seems to work properly.
Please review your site :)Best regards,
Nikko -
This topic was modified 4 years, 6 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.