Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

images in a custom wp theme

Featured Replies

Hi, I'm trying to hard-code a image into a custom wordpress theme I'm developing, but the blimming thing won't show! Its strange because if I call images using the css background-image tag, they show fine, but I'm using the following code and it its just not showing. here's my html/php:

<a href="<?php echo get_option('home'); ?>">
<img src="<?php bloginfo('template_directory'); ?>test1.jpg" alt="test image" /></a>

 

The alt description shows, but no image. the image file is in the same folder as the php files. What am I doing wrong? I've been fighting the blimming thing all afternoon!

<?php echo trailingsla****(get_template_directory_uri()); ?>test1.jpg

 

...although really it would be neater as:

 

<?php echo trailingsla****(get_template_directory_uri()); ?>images/test1.jpg

Edited by Renaissance-Design

  • Author

OK, Tried that and all it does is output the path to the image, not display the image itself, heres the code I used (I took your suggestion and created a images folder)

<?php echo trailingsla****(get_template_directory_uri()); ?>images/test1.jpg

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.