A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearhyperlink on php - page 1
User InfoPosts
hyperlink on php#1
I'm working on a wordpress template and need to add a hyperlink to the cartoon bubble at the top of the page. The bubble, as far as I can tell, is php. Where do I insert the href?

<h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>




The href should point to www.ojaivalleynews.com

The blog url is www.ovnblog.com if you want a visual on the bubble. I've used firebug to ispect, but alas I don't know enough about php to make sense of it.

Thanks

UPDATE...

I missed the second line of code regarding the above question, and based off of the suggestions here, have made corrections to this line and it works.

<h1><a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div id="bubble"><p><a href="http://www.ojaivalleynews.com/" target="_blank"><?php bloginfo('description'); ?></p></div>


Thanks for everyone's help. An upvote for everybody!

posted date: 2008-12-28 12:56:00


Re: hyperlink on php#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-28 12:56:01


Re: hyperlink on php#3
What do you mean, "insert the href"? Does bloginfo('url') include the domain name? Also, are bloginfo() return values escaped? If they aren't, see the htmlspecialchars PHP function.

posted date: 2008-12-28 13:01:00


Re: hyperlink on php#4
Rereading your question several times makes me think you aren't the writer of this code. In that case, are you trying to replace the URL of that link? If so, change "<?php bloginfo('url'); ?>/" to "ojaivalleynews.com/".

posted date: 2008-12-28 13:02:00


Re: hyperlink on php#5
Don't you have to echo the return values of the function?<h1><a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a></h1>

posted date: 2008-12-28 13:03:00


Re: hyperlink on php#6
Not if the function itself echo's the return value.

posted date: 2008-12-28 13:07:00


Re: hyperlink on php#7
Can't believe I didn't see that myself. However, I'm not sure if that's the problem (which isn't too clear in the first place).

posted date: 2008-12-28 13:08:00


Re: hyperlink on php#8
<h1><a href="http://www.ojaivalleynews.com/"><?php bloginfo('name'); ?></a></h1>I think that's what you want, but I can't be sure...

posted date: 2008-12-28 13:11:00


Re: hyperlink on php#9
if you want to replace this with another -static- link it should be:<h1><a href="http://www.ojaivalleynews.com"><?php bloginfo('name'); ?></a></h1>

posted date: 2008-12-28 13:12:00


Re: hyperlink on php#10
just replace the <?php bloginfo('url'); ?>/withhttp://www.ojaivalleynews.com

posted date: 2008-12-28 13:15:00


Re: hyperlink on php#11
ok I got it :) you 're right

posted date: 2008-12-28 13:17:00


Re: hyperlink on php#12
@rashneon, See @Laodimos's answer, @Scott Evernden's answer, or @Paolo Bergantino's answer (which are all the same thing).

posted date: 2008-12-28 13:23:00


select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.