creativedot Posted December 19, 2011 Share Posted December 19, 2011 Hello PHPfreaks.... 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!!! Quote Link to comment https://forums.phpfreaks.com/topic/253464-wordpress-php-needs-small-customization-i-need-help/ Share on other sites More sharing options...
creativedot Posted December 19, 2011 Author Share Posted December 19, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/253464-wordpress-php-needs-small-customization-i-need-help/#findComment-1299281 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.