• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

image not showing

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › image not showing

This topic is: not resolved

Tagged: get_stylesheet_directory_uri(), image path, image url

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 10 months ago by oceansize.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 9, 2017 at 6:47 am #210168
    oceansize
    Participant

    Hi,
    I'm trying to display a image on my site (from the function.php file) but the url seems to be incorrect. My code is:

    add_action( 'genesis_header', 'header_logo', 5 ); 
    function header_logo() {
    	echo '<img src="<?php get_template_directory_uri(); ?>/images/val-sabin-publications-and-training-logo.png">';
    }

    I've tried <?php bloginfo('template_directory'); ?> and <?php echo get_template_directory_uri(); ?> but still no image.

    Any help would be welcome.

    https://www.sportyandfriends.com/
    August 9, 2017 at 6:53 am #210170
    Brad Dalton
    Participant

    Use get_stylesheet_directory_uri for child themes.

    $image = sprintf( '%s/images/img.jpg', get_stylesheet_directory_uri() );
    
    echo $image;
    

    Tutorials for StudioPress Themes.

    August 9, 2017 at 8:18 am #210175
    oceansize
    Participant

    Thanks for replying Brad, that seems to show me the full url of the image on the website but I found the code I needed on your very helpful site-

    Using printf & sprintf In WordPress – 12 Code Examples

    Thanks again.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble