DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Reply
 
Thread Tools Display Modes
Old 07-29-2006, 02:03 PM   #1
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default PHP, link, image -- help!

I have the PHP below in WordPress for a site name/logo and description. I want to replace the text with an image, but I cannot for the life of me figure out how to do it while retaining the spider-readable HTML and the clickable link.
Code:
<h1 id="title">
  <a href="<?php echo get_settings('home'); ?>/" title="
  <?php bloginfo('name'); ?>">
  <?php bloginfo('name'); ?></a> 
</h1>

[. . .]

<p id="description">
  <?php bloginfo('description'); ?>
</p>
Treating the PHP stuff as if it were ordinary HTML (i.e., marking it as a comment) doesn’t work. WordPress retains the space and I lose the link.

Someone suggested using a huge negative margin to move the text out of human sight, but that feels pretty tacky to me.

Right now I am using display: none; for both the H1 and the P text.

Now what? I am sure it will be simple and I will feel like an idiot, but . . .

::

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 07-29-2006, 02:32 PM   #2
iamback
Member
 
iamback's Avatar
 
Join Date: Oct 2005
Location: Amsterdam, NL
Posts: 4,894
Default

Quote:
Originally Posted by ktinkel
I have the PHP below in WordPress for a site name/logo and description. I want to replace the text with an image, but I cannot for the life of me figure out how to do it while retaining the spider-readable HTML and the clickable link.
HTML Code:
<h1 id="title">
  <a href="<?php echo get_settings('home'); ?>/"
  title="<?php bloginfo('name'); ?>">
  <?php bloginfo('name'); ?></a> 
</h1>

[. . .]

<p id="description">
  <?php bloginfo('description'); ?>
</p>
Treating the PHP stuff as if it were ordinary HTML (i.e., marking it as a comment) doesn’t work. WordPress retains the space and I lose the link.
If I understand correctly, I think you'll want something like this:
HTML Code:
<h1 id="title">
  <a href="<?php echo get_settings('home'); ?>/"
  title="<?php bloginfo('name'); ?>" >
  <img src="myimage.png" alt="<?php bloginfo('name'); ?>" /></a> 
</h1>

[. . .]

<p id="description">
  <?php bloginfo('description'); ?>
</p>
That assumes XHTML, of course (otherwise change /> into >); the link text just becomes the alt attribute for the image. That should be good enough for the spiders.

   
__________________
Marjolein Katsma
Look through my eyes on Cultural Surfaces (soon!), My ArtFlakes shop and Flickr.
Occasionally I am also connecting online dots... and sometimes you can follow me on Marjolein's Travel Blog
iamback is offline   Reply With Quote
Old 07-29-2006, 02:32 PM   #3
Kelvyn
Staff
 
Kelvyn's Avatar
 
Join Date: Feb 2005
Location: In the Heart of the English Lake District
Posts: 1,381
Default

I assume it is the description you wish to conceal? If you still want the title & description to be Googled then move the div off the visual page. Googles' "preferred" way (ie with no penalty so far) is to overlay the image over the text - but this is not always possible. Using display:none; is not recommended as they are getting better at picking up hidden text.

   
__________________
Kelvyn

Web site design, hosting and marketing, Keswick in the UK Lake District

If you are planning a visit to Keswick then try Keswick Tourist Information website

Kelvyn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avatar is now a link? gary How to Use the Forum 73 08-28-2006 07:20 PM
Image problem, alt, not image dthomsen8 Web Site Building & Maintenance 6 03-21-2006 09:01 AM


All times are GMT -8. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.