Replace text with image?

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
aq-l
Forum Newbie
Posts: 1
Joined: Wed Dec 29, 2010 2:47 am

Replace text with image?

Post 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>
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Replace text with image?

Post 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.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
thecodewall
Forum Commoner
Posts: 33
Joined: Sun Dec 26, 2010 8:37 am

Re: Replace text with image?

Post by thecodewall »

maybe this will give you a hint.
<img src="address.png" onclick="javascript:document.location.href='<?php echo /*some address*/; ?>'">
Post Reply