PHP / Wordpress Pros .. Please help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WarChild
    Let slip the dogs of war.
    • Jan 2003
    • 17263

    #1

    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
    Confirmed User
    • Sep 2007
    • 314

    #2
    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); ?>


    Comment

    • WarChild
      Let slip the dogs of war.
      • Jan 2003
      • 17263

      #3
      Originally posted by moogle
      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.
      .

      Comment

      • Swish
        Confirmed User
        • Mar 2006
        • 1421

        #4
        What about:

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


        Naughty America - Director of Technology
        It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
        swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!

        Comment

        • DiliBau
          Registered User
          • Nov 2007
          • 9

          #5
          try swishs` version... should work
          Last edited by DiliBau; 12-17-2007, 02:40 PM.

          Comment

          • WarChild
            Let slip the dogs of war.
            • Jan 2003
            • 17263

            #6
            Originally posted by Swish
            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?
            .

            Comment

            • jimbona
              Confirmed User
              • Jan 2007
              • 190

              #7
              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); ?>
              Thanks
              Paul
              Thunder-Ball.net - Member

              Comment

              • WarChild
                Let slip the dogs of war.
                • Jan 2003
                • 17263

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

                Anyone familiar with it?
                .

                Comment

                • Boobs
                  Confirmed User
                  • Aug 2006
                  • 7875

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

                  Join the fucking best in big tit sponsors!!!

                  Comment

                  • Boobs
                    Confirmed User
                    • Aug 2006
                    • 7875

                    #10
                    possibly the " " symbols were messing it up ?

                    Join the fucking best in big tit sponsors!!!

                    Comment

                    • TommySoprano
                      Confirmed User
                      • Jul 2007
                      • 111

                      #11
                      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


                      Sig too big???

                      ExtraordinaryWay
                      Exclusive Custom Ads, Banners and other Ads
                      Adult Design, Tour Pages, Affiliate Design
                      Cool Custom WordPress Themes w install

                      Flash Video Players
                      Afiiliate code ready custom flash video players!!!

                      Make a wish! ICQ: 190430478

                      Comment

                      Working...