Hello,
Using the page builder with the big grid and the blocks, bring my homepage (for example) to have 180 internal links. I want to reduce this number by removing the links from the thumbnail images. How can I leave only the titles linked (without the duplication of the same link over the image).
thank you,
–Uri–
Hi
Replace the code from td_module.php with this one: http://pastebin.com/AwFsgQNV then edit the indicated files like here: http://screencast.com/t/vn0md7OJrq2 The result can be seen in this screen: http://screencast.com/t/i38qgdteK6a
You can use this method to remove the link from any thumb displayed in modules. Just add the true value in get_image() function as I indicated in above screen but in the file which generate that module.
Thanks!
Hi Andrei.
after i replacing the td_module.php i get this error:
Parse error: syntax error, unexpected 'class' (T_CLASS) in /home2/investingate/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_module.php on line 1
Hi
Sorry about that, I’ve made a mistake when I pasted the code inside pastebin.
Try this code, it should work fine: http://pastebin.com/cqj3Gjba
Thanks
Hi
same Error
Parse error: syntax error, unexpected 'class' (T_CLASS) in /home2/investingate/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_module.php on line 1
Thanks!
Hi
I am not sure why this error appear on your site as the cede it’s tested and works fine. Try to replace only this function in td_module.php file. The function begin here: http://screencast.com/t/s9R3SxjokIL and ends here: http://screencast.com/t/5DMZLPKdApi Delete the origilanl function then paste this one:
function get_image($thumbType, $no_link_image = false) {
$buffy = ''; //the output buffer
$tds_hide_featured_image_placeholder = td_util::get_option('tds_hide_featured_image_placeholder');
// do we have a post thumb or a placeholder?
if (!is_null($this->post_thumb_id) or ($tds_hide_featured_image_placeholder != 'hide_placeholder')) {
if (!is_null($this->post_thumb_id)) {
//if we have a thumb
// check to see if the thumb size is enabled in the panel, we don't have to check for the default wordpress
// thumbs (the default ones are already cut and we don't have a panel setting for them)
if (td_util::get_option('tds_thumb_' . $thumbType) != 'yes' and $thumbType != 'thumbnail') {
//the thumb is disabled, show a placeholder thumb from the theme with the "thumb disabled" message
global $_wp_additional_image_sizes;
if (empty($_wp_additional_image_sizes[$thumbType]['width'])) {
$td_temp_image_url[1] = '';
} else {
$td_temp_image_url[1] = $_wp_additional_image_sizes[$thumbType]['width'];
}
if (empty($_wp_additional_image_sizes[$thumbType]['height'])) {
$td_temp_image_url[2] = '';
} else {
$td_temp_image_url[2] = $_wp_additional_image_sizes[$thumbType]['height'];
}
$td_temp_image_url[0] = td_global::$get_template_directory_uri . '/images/thumb-disabled/' . $thumbType . '.png';
$attachment_alt = 'alt=""';
$attachment_title = '';
} else {
// the thumb is enabled from the panel, it's time to show the real thumb
$td_temp_image_url = wp_get_attachment_image_src($this->post_thumb_id, $thumbType);
$attachment_alt = get_post_meta($this->post_thumb_id, '_wp_attachment_image_alt', true );
$attachment_alt = 'alt="' . esc_attr(strip_tags($attachment_alt)) . '"';
$attachment_title = ' title="' . esc_attr(strip_tags($this->title)) . '"';
if (empty($td_temp_image_url[0])) {
$td_temp_image_url[0] = '';
}
if (empty($td_temp_image_url[1])) {
$td_temp_image_url[1] = '';
}
if (empty($td_temp_image_url[2])) {
$td_temp_image_url[2] = '';
}
} // end panel thumb enabled check
} else {
//we have no thumb but the placeholder one is activated
global $_wp_additional_image_sizes;
if (empty($_wp_additional_image_sizes[$thumbType]['width'])) {
$td_temp_image_url[1] = '';
} else {
$td_temp_image_url[1] = $_wp_additional_image_sizes[$thumbType]['width'];
}
if (empty($_wp_additional_image_sizes[$thumbType]['height'])) {
$td_temp_image_url[2] = '';
} else {
$td_temp_image_url[2] = $_wp_additional_image_sizes[$thumbType]['height'];
}
/**
* get thumb height and width via api
* first we check the global in case a custom thumb is used
*/
if (($td_temp_image_url[1] == '') and ($td_temp_image_url[2] == '')) {
$td_thumb_parameters = td_api_thumb::get_by_id($thumbType);
$td_temp_image_url[1] = $td_thumb_parameters['width'];
$td_temp_image_url[2] = $td_thumb_parameters['height'];
}
$td_temp_image_url[0] = td_global::$get_template_directory_uri . '/images/no-thumb/' . $thumbType . '.png';
$attachment_alt = 'alt=""';
$attachment_title = '';
} //end if ($this->post_has_thumb) {
$buffy .= '<div class="td-module-thumb">';
if (current_user_can('edit_posts')) {
$buffy .= '<a class="td-admin-edit" href="' . get_edit_post_link($this->post->ID) . '">edit</a>';
}
if ($no_link_image == true){
$buffy .= '<img width="' . $td_temp_image_url[1] . '" height="' . $td_temp_image_url[2] . '" class="entry-thumb" src="' . $td_temp_image_url[0] . '" ' . $attachment_alt . $attachment_title . '/>';
// on videos add the play icon
if (get_post_format($this->post->ID) == 'video') {
$use_small_post_format_icon_size = false;
// search in all the thumbs for the one that we are currently using here and see if it has post_format_icon_size = small
foreach (td_api_thumb::get_all() as $thumb_from_thumb_list) {
if ($thumb_from_thumb_list['name'] == $thumbType and $thumb_from_thumb_list['post_format_icon_size'] == 'small') {
$use_small_post_format_icon_size = true;
break;
}
}
// load the small or medium play icon
if ($use_small_post_format_icon_size === true) {
$buffy .= '<span class="td-video-play-ico td-video-small"><img width="20" class="td-retina" src="' . td_global::$get_template_directory_uri . '/images/icons/video-small.png' . '" alt="video"/></span>';
} else {
$buffy .= '<span class="td-video-play-ico"><img width="40" class="td-retina" src="' . td_global::$get_template_directory_uri . '/images/icons/ico-video-large.png' . '" alt="video"/></span>';
}
} // end on video if
}
else{
$buffy .='<a href="' . $this->href . '" rel="bookmark" title="' . $this->title_attribute . '">';
$buffy .= '<img width="' . $td_temp_image_url[1] . '" height="' . $td_temp_image_url[2] . '" class="entry-thumb" src="' . $td_temp_image_url[0] . '" ' . $attachment_alt . $attachment_title . '/>';
// on videos add the play icon
if (get_post_format($this->post->ID) == 'video') {
$use_small_post_format_icon_size = false;
// search in all the thumbs for the one that we are currently using here and see if it has post_format_icon_size = small
foreach (td_api_thumb::get_all() as $thumb_from_thumb_list) {
if ($thumb_from_thumb_list['name'] == $thumbType and $thumb_from_thumb_list['post_format_icon_size'] == 'small') {
$use_small_post_format_icon_size = true;
break;
}
}
// load the small or medium play icon
if ($use_small_post_format_icon_size === true) {
$buffy .= '<span class="td-video-play-ico td-video-small"><img width="20" class="td-retina" src="' . td_global::$get_template_directory_uri . '/images/icons/video-small.png' . '" alt="video"/></span>';
} else {
$buffy .= '<span class="td-video-play-ico"><img width="40" class="td-retina" src="' . td_global::$get_template_directory_uri . '/images/icons/ico-video-large.png' . '" alt="video"/></span>';
}
} // end on video if
$buffy .= '</a>';
}
$buffy .= '</div>'; //end wrapper
return $buffy;
}
}
If you still can’t manage to solve this issue please address us via email at contact@tagdiv.com and provide wp-admin and ftp access so we can take a closer look at this issue.
Thanks!
-
This reply was modified 10 years by
Andrei L..