开发者

Wordpress - image's absolute path within a function

开发者 https://www.devze.com 2023-01-08 00:20 出处:网络
I\'m developing a wordpress theme for general release. I want to display an image beside the \"previous post/next post\" (if there the function is true), however, relative paths aren\'t showing up. He

I'm developing a wordpress theme for general release. I want to display an image beside the "previous post/next post" (if there the function is true), however, relative paths aren't showing up. Here's the code:

<?php previous_posts_link(__( 'Newer posts <i开发者_开发知识库mg src="/wp-content/themes/basix/images/icons/arrow_right.gif" alt="previous post icon" />', 'basix' )) ?>

The image doesn't show up, removing the first forward slash also doesn't work. I was trying to use absolute paths using bloginfo('stylesheet_directory'), but this function just outputs the html characters, seperate from the link.


Use get_bloginfo() not bloginfo() - get_bloginfo() returns the value as bloginfo() echo'es it.

0

精彩评论

暂无评论...
验证码 换一张
取 消