Many thanks to Nathan Powell for the fix.
Changing get_stylesheet_directory()
to get_stylesheet_directory_uri()
will return the correct URL
.
get_stylesheet_directory()
returns the absolute server path to child or parent theme (hence my previous issue) whereas get_stylesheet_directory_uri()
returns the properly formed URI of child or parent theme.
I suppose the lesson is to pay close attention to exactly what function you’re using as WordPress has many similarly named plugins.
You can check out the codex docs here:
get_stylesheet_directory() & get_stylesheet_directory_uri()
Related Posts:
- Redirect to another page using contact form 7? [closed]
- Can export gallery but can’t import it Wp all import
- Optimise wordpress database using SQL after deleting registered images from Media Folder
- How to Upload images to a custom folder in upload folder using media uploader
- Product Page loads terribly slow when product gallery images are added
- Woocommerce resize existing product images
- How to show image caption in Woocommerce gallery
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- How can I restrict image upload dimensions for non-admin WordPress users?
- Add woocommerce variation images in gallery?
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Woocommerce dependent plugin
- How to check current user before all actions and filters?
- New databes tables with – WooCommerce – for developers [closed]
- How to send an automated email to the customers when product is added woocommerce
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- woocommerce product countdown not showing in variable product? [closed]
- Change commission_status paid when withdraw_status vendor is completed
- I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
- Is there a way to create custom product templates based on category on WooCommerce?
- Woocommerce Deposit, then random payments until product paid in full [closed]
- wp_generate_attachment_metadata is creating an empty array
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- custom payment gateway in woocommerce failed to connect to remote api server
- Force media library editor to overwrite the original filename?
- Programmatically Process Order through WooCommerce/Stripe Payment Gateway [closed]
- Replacing a plugin function with a custom renamed function doesn’t work
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Multiple Billing forms in WooCommerce (one billing form per product)
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Change Product Addon price based on select Variation
- WooCommerce – Maximum qty per line per product
- Woocommerce Create custom product type with variations
- Contact Form 7 Get Image Function [closed]
- Remove /product/ from url. I want only category name then product name
- How generate 200% image size and save with suffix @2x
- Pre booking doesn’t work with custom bootstrap modul in woocommerce [closed]
- Load external images via proxy
- WooCommerce specifc variations for specific user role [closed]
- Save custom attributes of product in woocommerce
- Filtering WooCommerce Orders by Category
- Bulk edit WP posts to update embeded images with new alt tags
- trying to get product category image in woo-coomerce
- How to add checkboxes for a woocommerce product? [closed]
- Why am I getting ( WooCommerce Services could not be installed (Could not create directory.). ) error and how to solve it ?
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Product queue for my subscription box
- Want to Show Sub categories under Categories section using Woo Commerce [closed]
- how to do login using woocommerce rest api From android
- Custom Pages for Woocommerce Product-Category Pages
- Woocommerce Minimum Price for a Composite Product to add in cart
- Add padding while generating thumbnail
- creating a custom shop page display on archive woocommerce
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Retrieving Meta from Image Attachment
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Make change in media library affect images in published articles
- Adding (image) caching to my Tumblr widget
- How to upload multiple files/images when developing a wordpress plugin?
- Image Manager Plugin [closed]
- Implementing an image hosting website using WordPress? [closed]
- Woocommerce Shop page variation product button replace with add to cart button
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- WooCommerce search products between price range using WP_Query
- Bulk Image Upload And Rerrange Functionality
- How to apply lazy loading in background images [closed]
- How to use add_submenu_page() for editors?
- PHP Error When a plugin is active
- woocommerce with custom post type
- Woocommerce showing images blurry in description page
- Slider/text combination plugin
- Plugin to hide image in excerpt
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- Exact Hook to payment methods
- Restrict content based on buy woocommerce product
- Image change on hover
- How to write “alt” tag in image for wordpress code?
- How to get a list of bundled products using wp_query in woocommerce
- How do I get a post author’s image/avatar via RSS from another blog?
- Hide a Menu Item on Login
- In Woocommerce theme need to add custom external link [closed]
- Getting taxonomy images to display on single-post with their terms
- Photo Gallery Plugin and Touch Devices
- Image crop, resize and compression plugin?
- How to Resize the Custom Post Images?
- Plugin that will let me specify a number of image sizes?
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- Product count in archive page Title in WooCommerce [closed]
- Add item to the woocommerce dashboard menu from a plugin
- Images under 1MB are not being compressed
- Skewed / slanted button within elementor [closed]
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- How to get the particular product quantity in orders in Woocommerce [closed]
- How can I automatically download all images from all imported posts, place them on my new host, and replace all the links
- Get Every Key & Value from Array then Display All in New Line