Jump to content

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!!!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.