You should echo it and also you are closing your php tag improperly. View source the o/p generated to get some idea
img<src=<?php echo get_template_directory_uri()."/assets/img/flexslider/flex-1.jpg"?> alt="alternative_name">
or you can use bloginfo which is easier to remember and use (You need not echo)
<img src="<?php bloginfo('template_url'); ?>/assets/img/flexslider/flex-1.jpg"/>
Related Posts:
- Overwrite Parent Theme add_image_size in Child Theme
- How to add css class to image attached in all the posts?
- Control the srcset much more (not all sizes in it each time)
- Way to store featured image width and height in two separate variables?
- Add image size if page template
- Is it ok to use a function to output the text domain name in a wordpress theme
- Set JPEG compression for specific custom image sizes
- remove links from images using functions.php
- Issue with wp_get_attachment_image() and SVG file type
- Removing default image size list in Media Box
- TinyMCE custom styles remove class when switching styles
- How to create thumbnails for PDF uploads?
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Overriding core functions in child theme
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Gallery images titles – get from post
- Remove images from get_the_excerpt
- Dequeue Scripts and Style for Mobile not working?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Best way to programatically add “rel” attributes to page and post images
- How to add background image control to page admin controls?
- Best Practice for Syncing Local Development With Staging Development [closed]
- Images uploaded using media uploader are appearing upside down
- How to use thumbnails in gallery?
- Count total number of images in post and echo results as number
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- How to use Internationalized human_time_diff() function in Chinese?
- is_dynamic_sidebar always returns true while using Jetpack visibility
- Automatically wrap multiple images in div
- Overwriting Parent Theme’s Image Sizes
- Override a theme function in a child theme?
- Pulling Twitter RSS feed not working as expected (fatal error)
- Image rotation fails to regenerate custom sized thumbnail
- Use register_setting() in a loop
- Add dynamic links in WordPress custom theme
- WordPress menu link doesn’t work properly
- Search filter by Post title OR Meta Title Value [duplicate]
- show first 3 thumbnails of posts in different sizes [closed]
- how can I edit flexslider in woocommerce. [Urgent]
- Getting custom image size URL in functions
- Set spesific size of featured images
- Unique sequential reservation code
- Usage of theme name in functions
- media resize/crop possibilities?
- Functions.php Problem
- ACF not showing
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- srcset and custom field get_post_meta and wp_get_attachment_url
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- Excerpt for pages not showing
- Does size of a theme’s functions.php file matter?
- Functions php shortcode for displaying main menu with no child items
- What are the meta fields for an attachment?
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- PHP 7.1 | Warning: A non-numeric value encountered in
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- Add attribute only to first image of every post via functions.php
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- Need to convert image url to a Base_64 data url with wordpress function..
- Combine two active_callbacks into one on theme customizer
- WP Customizer API loaded into functions.php
- call_user_func_array() expects parameter 1 to be a valid callback, function
- Is this an acceptable practice for WordPress theme development?
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- Using add_image_size in functions.php to get original uploaded file
- Custom image sizes showing in Classic Editor only when upladed directly to post
- how can I change all wordpress media file url to custom cdn url?
- How to fix Function create_function() is deprecated in / themes
- How to change images url in function.php?
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- Class parameter in get_avatar args doesn’t get added to output
- Is_Page doesnt detect my page
- How to customize archive widget only for cpt?
- wp_title() return random number
- Images with overlay
- How to offset main query without affecting other queries and backend
- Add meta data in head from theme
- what is `get_section()` and how to use it?
- Printing medium sized image
- HowTo: Add wrapper to columns shortcode?
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- How to create admin ajax function for my contact form
- How to disable site title and description when custom header is uploaded on the customizer?
- Zip all (original) images from media gallery
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Update add_image_size
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Save the outputted image into the Media Library, with a different filename and extension
- Function the_content
- Load a Child Theme’s style.css just before the closing tag
- Dynamically adding Captions to images
- Full size image option removing problem
- Add the title of a widget as an ID – for anchor links
- Image width issue in IE [closed]
- Why functions metaboxes is causing White Screen in Admin [closed]
- image_size with respect to aspect ratios