[Req] How to Add Image instead of Text in PHP

Status
Not open for further replies.

ashutariyal

Active Member
137
2008
4
0
Hello Friend I just need your help to add image in my php file instead of text :
Here is my file's php code
PHP:
<?php if ( is_single() ) { ?>
    <div class="navigation" style="border-top:0;">
        <div class="alignleft"><?php previous_post_link('%link','&laquo; Previous Post'); ?></div>
        <div class="alignright"><?php next_post_link('%link','Next Post &raquo;'); ?></div>
        <div style="clear:both;"></div>
    </div>
<?php } else { ?>
    <?php if ( function_exists('wp_pagenavi') ) { ?>
        <?php wp_pagenavi(); ?>
    <?php } else { ?>
        <div class="navigation">
            <?php posts_nav_link('', '&laquo; Previous Page', 'Next Page &raquo;'); ?>
        </div>
    <?php } ?>
<?php } ?>
now i want to add a image (previouspost.png) instead of &laquo; Previous Post and 2nd image (nextpost.png) instead of Next Post &raquo;

Hope you will help me...
 
5 comments
Just remove
PHP:
<?php posts_nav_link('', '&laquo; Previous Page', 'Next Page &raquo;'); ?>
And just add the html code?

Code:
<a href="linkhere"><img src="image.png" /></a>
 
Try this:
PHP:
<?php if ( is_single() ) { ?>
    <div class="navigation" style="border-top:0;">
        <div class="alignleft"><?php previous_post_link('%link','<img src="previouspost.png" />'); ?></div>
        <div class="alignright"><?php next_post_link('%link','<img src="nextpost.png" />'); ?></div>
        <div style="clear:both;"></div>
    </div>
<?php } else { ?>
    <?php if ( function_exists('wp_pagenavi') ) { ?>
        <?php wp_pagenavi(); ?>
    <?php } else { ?>
        <div class="navigation">
            <?php posts_nav_link('', '<img src="previouspost.png" />', '<img src="nextpost.png" />'); ?>
        </div>
    <?php } ?>
<?php } ?>
I am not sure which cms is that! It may work assuming previous_post_link & next_post_link are functions which automatically binds next page link
 
Status
Not open for further replies.
Back
Top