Info
- 9 posts
- 2 voices
- Started 5 years ago by startribe
- Latest reply from startribe
- This topic is resolved
code for refrencing template directory
-
- Posted 5 years ago #
Hey Community,
I am trying to link to an image in the "my-templates" directory for my bbpress template. When editing templates in WordPress I used:
<?php bloginfo('stylesheet_directory'); ?>Is there something similar that I can use for bbPress?
I tried:
<?php bb_stylesheet_uri(); ?>
& it didn't work.Anyhow, any help would be greatly appreciated.
Thanks,
Orion -
- Posted 5 years ago #
<?php bb_stylesheet_uri(); ?> does work for me!?
Anyways, you can also do something like following I did in bbpress-mobile plugin:
<?php $stylesheet = (bb_get_option('uri') . 'my-templates/mobile.css'); ?>
<link rel="stylesheet" href="<?php echo $stylesheet; ?>" type="text/css" />Trent
-
- Posted 5 years ago #
Hey Trent,
Thanks for the reply...
I checked out the source of the resulting page and found this...
/my-templates/style.cssimages/victorylogo.gif
So I noticed that it is posting "style.css" in the path, which is throwing me off.Essentially, I am trying to get into my "my-templates" directory. I will look into your other solution. If you have any other ideas, I am open ears.
Thanks,
Orion -
- Posted 5 years ago #
If you are trying to get victorylogo.gif, I would use:
<?php $victorylogo = (bb_get_option('uri') . 'my-templates/images/victorylogo.gif'); ?>
<?php echo $stylesheet; ?>There might be an easier way, but I am a 'may not be pretty, but works' type of guy....
Trent
-
- Posted 5 years ago #
lol...
yeah, any solution is good to start for me. The above produced:
front-pageimages/victorylogo.gifI am editing the front-page.php, so I am not sure if it pulled that file name or I have a setting a bit off somewhere.
Hmmm.... there has to be a way. I am getting the images to load through CSS, but for this particular image I would like to have it in the HTML content.
So any more ideas or suggestions are welcome.
-Orion
-
- Posted 5 years ago #
actually, I forgot to load the file, the result above was from playing with
'<?php bb_location(); ?>' and "image".After trying your code Trent, I received no results for the designated area:
src="" -
- Posted 5 years ago #
YES! I got it... I used this to get the correct path:
<?php bb_option('uri'); ?>my-templates/images/victorylogo.gifAhhhh, and sigh. Trent, thanks for helping with getting my gears going. Now if anyone else runs into a similar issue, they will have a solution.
All the Best,
Orion -
- Posted 5 years ago #
Looking back at the code I put, I must have been tired! Great to hear you got it going Orion!
Trent
-
- Posted 5 years ago #
Thanks Trent, I am still pushing along... I understand, those late nights get to me too.
All the Best,
Orion -
This topic is
closed