Jump to content
#StayAtHome ×

Archived

This topic is now archived and is closed to further replies.

creativedot

Wordpress PHP needs small customization ...i need help!

Recommended Posts

Hello PHPfreaks.... :rtfm:

 

I am not a freak yet since i have no idea about PHP but i am hoping i will become one since this programming language is so important!

 

I am now working on a wordpress website and i need to customize the theme. I found my way around in doing most of the stuff but now

i am having difficulties adding a url link when user clicks on a photo

 

The code goes like this:

 

case 'brick5':
$w = 144;
$h = 294;
$shorten = esc_html( get_the_content() );
$shorten = galleryShorten($shorten, 300, '...');
$content = '<div class="colorInside"></div>
<a title="'.get_the_title().'" class="lightbox_image" href="'.$image_url.'"></a>
<div class="boxInside">
<div class="boxMargin">
<div class="brickTitle">'.get_the_title().'</div>
'.$shorten.'
</div>
<a class="brickMore" href="'.get_permalink().'"></a>
</div>';
$content .= '<img alt="'.get_the_title().'" src="'.get_bloginfo("template_url").'/lib/img.php?f='.$image_url.'&w='.$w.'&h='.$h.'&a=c" />';
break;

 

This code is actually adding an image (called brick5 in php) on my homepage ... when user clicks photo a light box image opens up with that photo in there... When you click on brickMore (which is a small + jpeg sign inside brick5) its takes you the post..

 

What i need to do is to change this so code so that when user clicks on photo, instead on lightbox it goes to this link "www.somelink.com" ... The same with brickMore...instead of going to the post it should go to that link

 

I tried this:

 

case 'brickCustom':
$w = 294;
$h = 144;
$shorten = esc_html( get_the_content() );
$shorten = galleryShorten($shorten, 300, '...');
$content = '<div class="colorInside"></div>
<a title="'.get_the_title().'"  href="http://www.somelink.com"></a>
<div class="boxInside">
<div class="boxMargin">
<div class="brickTitle">'.get_the_title().'</div>
'.$shorten.'
</div>
<a class="brickMore" href="http://www.somelink.com"></a>
</div>';
$content .= '<img alt="'.get_the_title().'" src="'.get_bloginfo("template_url").'/lib/img.php?f='.$image_url.'&w='.$w.'&h='.$h.'&a=c" />';
break;

 

It dosent work...am i missing something?

 

Thanks for your time in looking into this!!!

Share this post


Link to post
Share on other sites

Ok...the brickMore link works...and it does take me to the correct link! Now i only need to figure out how to get rid of that light box and add a link to the brick image

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.