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?
- Display random categories on the front page (Finding and Editing Theme Functions)
- remove links from images using functions.php
- How to get woocommerce inventory status [closed]
- How to create thumbnails for PDF uploads?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- How to override functions.php in child theme?
- Is it possible to maintain image aspect ratio when scaling images?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Gallery images titles – get from post
- Add inline css to theme
- How to add a rel attribute to images that contains their categories?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Display height and width properties with the_post_thumbnail() or related function
- Dequeue script in template isn’t working
- Add external js file to footer with id
- How to add background image control to page admin controls?
- Function to auto-set a featured image that is already in use
- Actions according to image type and size
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- How to call custom function from functions.php in site-wide template files?
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- How can you limit srcset on a single type of page?
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Overwriting Parent Theme’s Image Sizes
- Twentyten Child Theme: header images display messed up in admin panel
- Disable auto-resizing of uploaded images, but only for certain filename
- Use register_setting() in a loop
- Add dynamic links in WordPress custom theme
- how can I edit flexslider in woocommerce. [Urgent]
- enqueue styles for only mobile wp
- Jquery implementation not working on page reload
- Usage of theme name in functions
- Redirect to another page using contact form 7? [closed]
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- Limit dimensions of “Full” size images
- get_pages() Returns Only One Item
- How to hide image-url if no attachment?
- How to properly set custom logo size?
- Need To Change WordPress Meta Tags… Includes wordpress shortcodes
- How to Add Shortcode to html img code?
- Getting the teaser text without overriding global variables
- “options.php” not found
- Image Crop Not Working
- wp_nav_menu work in functions.php but not in the theme
- Use existing image sizes for WooCommerce
- Problem in using Customizer
- wp_get_attachment_image_src returns image on main domain, false on subdomain
- contact form in template with jquery,validate and ajax
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Retrieve First Image Function
- Custom Image Size in Insert Media
- Featured Image keeps cropping
- Prevent creating multiple image resizes in twentytwelve template
- Conditional function for excluding first image from content, not working
- Woocommerce Variable Product Dropdown for Custom Shop Template
- Different image using srcset function
- Exclude specific post from query
- Advanced method to control cache of enqueued style/script
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- Auto delete content in specific folder inside media library
- WordPress wp_dequeue_script remove all other scripts
- How to update an image attachment’s alt text from a custom field when saving a post?
- large image size of 1440×1440 not pulling 2x of 2880×2880 image
- Can You Set A Minimum Image Dimension For Resizing Images?
- Why does echo on functions.php not yield result in source code?
- (Divi): How to make WordPress load images of specific size for Blurb modules on given page with a funciton?
- How to wrap image tag into div for post only?
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to retrieve image IDs from shortcode content?
- restrict uploaded image size and fixed image display size
- Using Switch Statement to Change Image According to Last Digit of Topic ID
- Class::$template_dir_path=get_template_directory();
- Disable links to images only if link is an image
- Restricted images only for logged user. (hidden url)
- Different body image backgrounds on different pages, posts and categories
- wordpress not calling peliegro functions.php?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- wp_nav_walker that interacts with widgets to setup mega menu
- Open image size links in a page instead of direct image link
- Allow tags and attributes in post and pages content
- Function to get thumbnail img source
- Add custom css to theme
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- How to resize image from import image url?
- How to crop image in WordPress with aspect ratio for any size of image
- How to add height and width dimensions automatically to archive descriptions
- How to overwrite image if it already exists – WordPress, Gravity form
- Setcookie not setting cookies anywhere except admin
- How Do I Prevent Featured Image Caption Displaying Above And Below Image
- How to force Cover block to use the full size image resolution
- No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size