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
- How to Delete All regenerated thumbnails but keep the original ones?
- How to upload image with simple form?
- WooCommerce Always Include Shipping Information in Checkout [closed]
- Add Products to user’s ID Woocommerce
- Woocommerce different URL for every table placed in the restaurant
- Disable Admin Bar Render on Plugin Page
- Use Media Uploader in Plugin
- How to add product images using script?
- Woocommerce cart is a non-object inside `admin_post` action [closed]
- resize only height using wp_get_image_editor
- Get uploaded image url
- Layout shop page: resize images and columns
- How to crop image from center using wp_image_editor
- Invalid shipping method, WooCommerce [closed]
- Converting Attachment to Images?
- Bulk Image Uploader to create new post from each image [closed]
- How to add a random image to a post from gallery and only show one?
- Make specific products accessible only to a user role in WooCommerce
- How to edit Image layout in single product page in woocommerce on wordpress?
- Woocommerce – Display active variation product price [closed]
- Need Old Version of plugins
- Dropdown menu on custom page with product to choose number of products per page
- Set featured image randomly from WordPress Database on post submission
- Woocommerce Deposit, then random payments until product paid in full [closed]
- custom payment gateway in woocommerce failed to connect to remote api server
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Want to Show Sub categories under Categories section using Woo Commerce [closed]
- How to upload multiple files/images when developing a wordpress plugin?
- PHP Error When a plugin is active
- Plugin that will let me specify a number of image sizes?
- WooCommerce: Force coupon for existing/registered customers [closed]
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- Problem with add_action
- WooCommerce: after install hook
- Clear out old images, any advice?
- Add a “View all” button on WooCommerce product archives pages
- I am trying to make a field show and save from quickedit screen
- Cross Sells are not being shown in Cart Page. Please Help!
- How to display registered customer list as dropdown in WooCommerce checkout?
- Large amount image data transfer
- Get Image Having the ID [closed]
- Disable variations on woo commerce if out of stock
- Scrape a webpage for image and add it to post
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- Add_image_size not generating correct size
- Is there a way to insert multiple images into a post at the same time without using a gallery?
- Edit all $wp_scripts at once to $in_footer = false
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- How to make WooCommerce payment method field optional?
- WordPress – Ultimate Auction for WooCommerce
- Working on a product group in wordpress, where user choose how many children, wife and husband
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- Add Plugin broken after removing Booster for Woocommerce
- Show prices with tax Inclusive in Minicart widget
- How to add a PW Gift Card to a Woocommerce Order request API?
- Get all image in media Gallery with alt/title?
- How can I send the mail once?
- WPForms Custom Redirect not working
- Configure upload folder on WoComerce
- WordPress to be used more like an app?
- Do images in plugins automatically load?
- ACF Fields are not showing up on Homepage
- Make the product page as homepage WooCommerce
- BS Authorize.net Problem (Payment in hanging if customers is not logged in)
- Woocommerce product variation price: How to change price dynamically through hooks
- Getting all woocommerce products from REST API call in plugin
- Problem Advanced Custom Fields PRO
- WP_get_image_editor resizing images in a foreach loop
- my hook or my function wont run in the cronjob
- Implementing Scrollable Images
- Get a list of Product Categories inside a loop
- WooCommerce or any other plugin: Deliver JS and CSS through CDN without using a Plugin
- How to make cover image in post block expand to entire screen?
- Custom product page’s style for printing
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Woocommerce list variations that are added already to cart in Single Product
- {status}_{post_type} does not run correctly?
- Widget logic using woocommerce product category
- WordPress Theme Conflict With Plugin
- How to Save settings of custom tab product page in admin side in a database?
- Holding 2 wp_user in the same action (to update billing_email when user_email is updated)
- Retrieve post thumbnails
- Make a wordpress site similar to Hot Or Not – Image rating system [closed]
- Displaying single Instagram images as a tile
- How to execute init or woocommerce_init only for checkout page
- how to add “alt” for all image in wordpress
- Shortcode inside a redirect [closed]
- Create Custom Coupon Type
- Update acf field in woocommerce orders
- Add different sizes packaging boxes to orders plugin
- Achieve the following layout
- How To Convert External Image URLs To Own Website’s Uploaded Images Automatically?
- A multi-section WordPress store [closed]