Modify display of website link so address is visible
This topic contains 8 replies, has 4 voices, and was last updated by purpleedge 10 years, 6 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
August 21, 2014 at 1:00 pm #12733
Hi,
I was setting up a print.css today and I see the the actual website address of a listing isn’t displayed, and there is no easy way to change it because it is buried in heap of code.
I wonder if you can change the line in the code in custom_fields_functions to …
$html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.''.stripslashes(__($type['site_title'],GEODIRECTORY_TEXTDOMAIN)).'<span class="geodir_website_address">' . $website . '</span></span></div>';
So that the website address is displayed and can be formatted, or hidden as necessary. Or give us a hook so we can do this ourselves?
August 21, 2014 at 5:48 pm #12744Hi, I’ve alerted Stiofan.
August 21, 2014 at 7:19 pm #12750Hi,
Stiofan added a filter. Please replace custom_fields_functions.php with the file in the zip attached.
Filter to be used like this for example in your active theme functions.php add :
add_filter( 'geodir_custom_field_website_name', 'geodir_change_website_field_display_name', 10, 3 ); function geodir_change_website_field_display_name($name,$website,$post_id){ return $website; }
New filter will be added to the next version.
Thx
August 21, 2014 at 11:46 pm #12802Thanks very much! Can I be a pain?
Can you take the “strong” out?
$html = ‘<div class=”geodir_more_info ‘.$geodir_odd_even.’ ‘.$type[‘css_class’].’ ‘.$type[‘htmlvar_name’].'”><span class=”geodir-i-website” style=”‘.$field_icon.'”>’.$field_icon_af.’‘.apply_filters( ‘geodir_custom_field_website_name’, stripslashes(__($type[‘site_title’],GEODIRECTORY_TEXTDOMAIN)),$website, $post->ID ).’</span></div>’;
August 22, 2014 at 12:36 am #12812that can done with css?
.geodir_more_info strong {font-weight:normal;}
August 22, 2014 at 12:47 am #12815Hi Paolo,
Well, it’s just as easy to add the strong 😉
But no, I want the display like in my original image, or without the strong anywhere so it matches the other display fields on the detail page.
/* Change the way website link is displayed on detail page –*/
function geodir_change_website_field_display_name($name,$website,$post_id){
return ‘‘ . $name . ‘<span class=”geodir_website_address”>’ . $website . ‘</span>’;
}
add_filter( ‘geodir_custom_field_website_name’, ‘geodir_change_website_field_display_name’, 10, 3 );Produces…
<div class=”geodir_more_info geodir_website”>
<span class=”geodir-i-website” style=””>
<i class=”fa fa-link”></i>
Website
<span class=”geodir_website_address”>http://buy4baby.com.au</span></span>
</div></div>
…Which is perfect, and flexible for everybody! There is no way to get rid of the strong from the label otherwise.
August 22, 2014 at 9:15 am #12856Hi purple, when trying to paste code here please wrape it in the code tags (just highlight the code and then click the “code” button in the test editor)
As far as i can see all you have to do is add
.geodir_website strong{font-weight: normal;}
Stiofan
August 22, 2014 at 1:06 pm #12882Hi Stiofan, sorry tried to post it in blockquotes and pre, will try in code.
I was just trying to separate the formatting of the “label” from the url, if you keep the strong in there then everything is strong, if you leave it out then we can decide if one part is strong – like my image.
/* Change the way website link is displayed on detail page --------------------*/ function geodir_change_website_field_display_name($name,$website,$post_id){ return '<strong>' . $name . '</strong><span class="geodir_website_address">' . $website . '</span>'; } add_filter( 'geodir_custom_field_website_name', 'geodir_change_website_field_display_name', 10, 3 );
produces…
<a target="_blank" href="http://buy4baby.com.au"> <strong> Website </strong> <span class="geodir_website_address"> http://buy4baby.com.au </span> </a>
…a bit more flexibility. See image above.
August 27, 2014 at 3:29 am #13288Thanks guys,
I managed to get the website address to display like every other link in the sidebar with this css…
#top span.geodir_website_address {
font-weight:normal;
color: #889095;
}
#top span.geodir_website_address:hover {
font-weight:normal;
color: #c79a52;
}…would’ve been easier without the
<strong>
😉
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket