Instead of
get_template_url()
user
get_template_directory_uri()
for parent theme
and
get_stylesheet_directory_uri()
for child theme or parent theme if not child theme present
NOTE: this will require a slash like so:
$image_link_url = get_template_directory_uri() . '/images/placeholder_bg.png';
Related Posts:
- Apply class to every third list item? [duplicate]
- How to add elements to an empty array in PHP?
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- Where to get information about array fields in $_REQUEST?
- Pass a PHP variable to another file
- How to store the_title() into a variable to reutrn the value, not just echo it
- Variables declared in header not available in other includes
- How do I make my function add variables/values to the $post object?
- PHP/Manual use of images? – 2 Questions
- Adding Featured Image to Post programatically
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- How to upload imagick resource to media in wordpress
- How to add a featured image to a existing post via php?
- Variable not staying set
- Three Questions with Twenty Eleven theme
- Display related posts without a plugin
- Create a WordPress shortcode using PHP [duplicate]
- Resize image to specific dimension (X to Y ratio)
- How to pass a PHP $_GET variable and fetch/output it?
- Creating WordPress Shortcode with Variable
- How to put a form with php code into a variable or shortcode?
- persist a variable set in header.php all the way down to footer.php
- Automatically add images to a menu
- Get access to variable from previous pageview, excluding ajax-calls
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Insert page content into another page with a changed variable
- Pass Variables or Variable Place-Holder from Editor to PHP
- How to access or parse key/values that have “string”
- Using featured image of blog archive page
- if custom field doesn’t exist, use post thumbnail instead, as image background
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- javascript variable to wordpress php variable
- Help Fallback (thumbnail)
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- Filter results from a serialized string to use on statistics
- How to reference PHP in Javascript
- Get featured image with custom size outside WordPress
- How to add post thumbnail dynamically using Jquery?
- Else/If Statement to Display Photo Descriptions
- Store and Change Session variable – PHP SESSION VARIABLE
- PHP $_REQUEST array empty
- Overide Variable in Child Theme
- How to set a featured image (thumbnail) with PHP?
- How to change thumbnail src attribute?
- Error display post thumbnails for previous and next post
- echo var into wp_query
- how can I include some custom variable from functions.php?
- Dynamically adding filters
- Get the featured image url of clicked post
- Fallback image URL if no featured image exists via a shortcode function
- How to replace URL protocol using PHP?
- Call featured image url
- How to pick “full/thumbnail” images in the loop?
- Generate responsive post thumbnails of same size
- How to Make Thumbnail of Post Stay Animated
- Get the alt text of the image in a array
- Trying to change featured image from 180×180 to full width on home page
- Show different size featured images (the_post_thumbnail) for 1st, 2nd and 3rd posts?
- PHP variables in a post?
- Custom functions for string data calculations
- WordPress is removing query variables like page, p from the URL of a custom static page
- Need to add a post’s featured image to a section on the frontpage
- I can’t set image ad fatured programatically
- How to send a php var to jQuery Ajax call with two different file
- Unable to display multiple parameters from url by javascript through shortcodes
- How to check a variable Changes
- Add Featured Image to Existing Post
- wp_query – Exclude the first thumbnail from lazy loading on archives
- global $product is empty string when passed into function
- not outputting medium size image URL
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Replace background image with post thumbnail in shortcode
- Resize post thumbnail
- Custom global variable not working in function
- WordPress How do I pass a variable from one add_action to another?
- Best way to use variables in multiple functions?
- Trying to add some custom text into WordPress Post title via function.php
- How to put 2 php codes in functions.php without site crashing
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)
- How to add WordPress Featured image in tag ..?
- How do I fix Undefined variable using $_POST in function?
- WordPress generate images size after upload
- How to change the value of a variable using input field?
- Add a default style if no Featured image is selected
- How to link all featured images to custom url in single.php for only non-logged-in users?
- How to programmatically set existing image in media library the featured image for a post in wordpress
- Having trouble with customizing blog posts on the home page
- How to find php variable of wordpress theme settings
- How to link featured images in single.php for only non-logged-in users?
- Thumbnail wouldn’t scale to size properly
- problem in using wpdb->prepare and a string placeholder
- Add class to all meta boxes for a custom post type
- Passing parameter from the current URL to redirect to another url
- get_post_thumbnail_id returns a negative number
- Undefined variable & issue with smof_data
- Pulling a variable into the wp_nav_menu function