GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP / Wordpress Pros .. Please help! (https://gfy.com/showthread.php?t=792916)

WarChild 12-17-2007 03:22 PM

PHP / Wordpress Pros .. Please help!
 
I'm using the following on the single.php template file for post navigation:

<?php next_post_link('%link', '<img src="/images/next.gif" width="75" height="21" border="0">', FALSE); ?>

Works fine, but what I actually want to do is insert <?php bloginfo('template_directory'); ?> before the /images/next.gif.

I know I can't simply do:

<?php next_post_link('%link', '<img src="<?php bloginfo('template_directory'); ?>/images/next.gif" width="75" height="21" border="0">', FALSE); ?>

So hook can someone hook me up with the right format please? I don't want to learn php I just want to finish this damn template I started. :P

moogle 12-17-2007 03:47 PM

Why don't you just insert the URL of your template's directory?

ie:

<?php next_post_link('%link', '<img src="http:// www . domain . com /wp-content/ themes/ template/ images/ next.gif" width="75" height="21" border="0">', FALSE); ?>

WarChild 12-17-2007 03:52 PM

Quote:

Originally Posted by moogle (Post 13527721)
Why don't you just insert the URL of your template's directory?

ie:

<?php next_post_link('%link', '<img src="http:// www . domain . com /wp-content/ themes/ template/ images/ next.gif" width="75" height="21" border="0">', FALSE); ?>

Yes that will work of course, however I've painfully learned to do everything correctly while building my first theme and since everywhere else all the links and what not are dynamic, I'd kind of like to learn how to do this properly too.

Swish 12-17-2007 04:38 PM

What about:

<?php next_post_link('&#37;link', '<img src="' . bloginfo('template_directory') . '/images/next.gif" width="75" height="21" border="0">', FALSE); ?>

DiliBau 12-17-2007 04:39 PM

try swishs` version... should work

WarChild 12-17-2007 06:59 PM

Quote:

Originally Posted by Swish (Post 13527920)
What about:

<?php next_post_link('%link', '<img src="' . bloginfo('template_directory') . '/images/next.gif" width="75" height="21" border="0">', FALSE); ?>

Tried it but it doesn't work, it just outputs the template_directory but doesn't work with the link. Must have something to do with the wordpress function its self.

Anyone else?

jimbona 12-17-2007 08:18 PM

try
Code:

<?php
$image = '<img src="'.bloginfo("template_directory").'/images/next.gif" width="75" height="21" border="0">';

next_post_link('&#37;link', $image, FALSE); ?>


WarChild 12-18-2007 12:16 PM

Unfortunately that does the same thing as the earlier code. There's something peculiar about this Wordpress function.

Anyone familiar with it?

Boobs 12-18-2007 12:20 PM

<?php next_post_link('&#37;link', '<img src=<?php bloginfo('template_directory'); ?>/images/next.gif width=75 height=21 border=0>', FALSE); ?>

Boobs 12-18-2007 12:21 PM

possibly the " " symbols were messing it up ?

TommySoprano 12-18-2007 01:35 PM

Use this instead:

<?php next_post_link('%link', '<img src="' . get_bloginfo('template_directory') . '/images/next.gif" width="75" height="21" border="0">', FALSE); ?>

More help:
http://codex.wordpress.org/Template_Tags/get_bloginfo


All times are GMT -7. The time now is 01:36 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123