- That theme should not be using the
$
alias as WordPress loads
jQuery in “No Conflict” mode. - I can only assume the theme is loading its own jQuery, which is
pretty bad form. - The theme should really be registering and enqueuing the
script properly rather than just shoving code into the footer.
However, all other things equal and if your images are named numerically, then changing this:
var imgPath="/wp-content/themes/nexus/img/page-headers/<?php echo $name; ?>/1.jpg";
To this:
var imgPath = <?php echo site_url(); ?>/wp-content/themes/nexus/img/page-headers/<?php echo $name; ?>/<?php echo rand(1,5); ?>.jpg';
And it should echo images 1.jpg
through 5.jpg
randomly.
Related Posts:
- How to stick the footer to the bottom of the page? [closed]
- How to remove version and thank you message from the admin footer
- Can i put ‘page’ at the bottom of each page?
- footer.php – twentysixteen child theme – social links menu to output font awesome icons
- How to edit footer
- How do i change the footer?
- Where is the admin bar instantiated?
- Using wp_register_style to load CSS in footer?
- editing footer text in JBST theme
- How to find the right file with inspector? [closed]
- WordPress Footer Missing After Website Hack
- wp_footer hook not working inside a class if not single [closed]
- Identify the page I am viewing
- Removing a link below from footer
- WordPress Site footer on Firefox displays a error
- How to edit footer content
- Changing copyright year in Footer.php with Custom plugin
- footer does not respect css stylesheet
- How to fix the footer to the bottom of the screen
- Delete bullet points in footer menu [closed]
- Getting A Link below footer – Want to remove it. How?
- Editing footer for one page, keeping it the same for others
- Place Footer at bottom of page with short text
- Can’t deregister / dequeue scripts in WordPress
- Code for changing the size of the footer block (background) and font size
- How to add another image on footer.php
- On just 1 (new) page of my site there appears a wordpress footer with copyright 2012 which I want to remove
- Footer not visible
- how to edit part of footer
- How to remove the footer from a theme
- footer display problem
- How I can Delete Footer without using plugin BlankSlate?
- My footer has disappeared but only on my home page
- Meta Slider Lite plugin shortcode in post not working
- Footer with next/previous posts
- Move jquery ui to footer
- How do I change the footer (Norma) [closed]
- Re-position footer and force it to drop below blog post excerpts on home page [closed]
- How can I completely edit the footer?
- How to edit the WordPress footer
- How to Keep footer link remain intact?
- Footer Missing in website [closed]
- How to make a sticky footer in react?
- Flushing footer to bottom of the page, twitter bootstrap
- How To Remove WordPress Version From The Admin Footer
- How to add code to just before closing body tag
- How to add JS in footer
- Add script to footer – on post editor
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- enqueuing React script and hooking its target div fails to load script
- Add footer.php to WordPress child theme
- Why and how is twentythirteen adding a margin-top to my footer?
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- How can a Theme Contain no Header File or Footer File?
- Setting a page link in the footer?
- How can I customize wp_footer, where is the code that controls what this function does?
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- Execute Hook on the footer or header after activating a plugin
- Where would I place `wp_footer();`?
- Enqueue scripts in footer
- How can I change the do_action function in footer (copyright area)
- Understanding Theme specific Code
- Removing jQuery from footer
- Newbie: Help with Vertical Spacing on Footer Widget [closed]
- WordPress Unite Theme: Footer isn’t sticking [closed]
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Load CSS in footer, like your can with JS?
- Add Different Actions To Different Page’s wp_footer
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- WordPress 5.1 upgrade has lost the parent theme JavaScript
- Cannot change footer text?
- How to make footer area transparent? Using Avada and WordPress [closed]
- Multiple rows of footer widget areas
- get_header() in backend – but keep JavaScript and CSS files
- Call Shortcode on wp_footer
- Action inside another action not working
- Absolutely print script in footer
- Changing sidebar.php and footer.php depending on URL
- Custom headers in WordPress, are there also custom footers?
- wp_footer hook running twice
- How to add content above footer in posts from specific category
- Add custom border across footer widget area
- Defining path of content folder in WP-config solves the issue of missing header, footer, theme options. Is this a good approach? Expert Advice needed
- Some Widgets in the Right Side Bar and the whole Footer section is not working in a WordPress Site
- Loading different header and footer in woocommerce templates (AMP)
- How to add extra custom social icons to page with same style?
- How to change a theme’s footer image
- Page Contents showing in Footer Area
- Very weird behaviour after removing WP pages
- How to prevent a style sheet to affect a header.php or footer.php?
- Moving CDN jQuery to footer does not work?
- Show Header When Not In Iframe
- get_footer not working boilerplate theme
- Content in footer file
- 100% Width Footer – Custom Child Theme
- Footer in middle of page in different browers [closed]
- Require Credits Footer
- wp_footer content appearing in admin area
- Header and Footer options in pages and posts
- Footer option is missing in Customiser