Page 1 of 1

Replace text with image?

Posted: Wed Dec 29, 2010 2:59 am
by aq-l
Quick question; I feel this ought be pretty basic, but I've not yet found a way to make it work.

Within the code below, I'd like to simply replace the text links with small image links. In other words: 'PREVIOUS' with a small icon, 'EDIT' with a small icon and 'NEXT' with a small icon.

That's it.

Any thoughts? Help would be much appreciated — and I wouldn't have posted here if the answer to my question couldn't be found after thirty minutes on Google.

Thanks.

Code: Select all

<nav>
                            <ul>
                                <?php if(get_previous_post()): ?>
                                <li><?php previous_post_link('%link', __('PREVIOUS')); ?></li>
                        	    <?php else: ?>
                                <li><?php _e('PREVIOUS'); ?></li>
                        	    <?php endif; ?>
                        	    
                        	    <?php edit_post_link(__('EDIT'), '<li>', '</li>'); ?>
                        	    
                        	    <?php if(get_next_post()): ?>
                                <li><?php next_post_link('%link',  __('NEXT')); ?></li>
                        	    <?php else: ?>
                                <li><?php _e('NEXT'); ?></li>
                        	    <?php endif; ?>
                        	</ul>
                        </nav>

Re: Replace text with image?

Posted: Wed Dec 29, 2010 8:09 am
by social_experiment
You will have to edit the functions ( previous_post_link(), edit_post_link(), next_post_link() ) because it looks like they accept a value to use as link name. If you placed an <img> tag inside there my guess is that it would change the display for the worse.

Re: Replace text with image?

Posted: Wed Jan 05, 2011 12:33 am
by thecodewall
maybe this will give you a hint.
<img src="address.png" onclick="javascript:document.location.href='<?php echo /*some address*/; ?>'">