-
AuthorPosts
-
August 4, 2022 at 4:47 pm #1360662
Hello
the featured images (which are shown on top of every blogpost) are actually linked so that the image opens in a lightbox.
I dont want that.
The image should not have a link….just the image.
How do i tell Enfold not to link the featured image?And this also:
I use nextgengallery
When i click an image from the gallery it opens twice – one time by the NGG-lightbox and behind it there is another lightbox – probably from Enfold.
What i need:
NGG gallery images open by NGG-lightbox
All other images (except the featured image) handeld by the Enfold lightbox if i decided to put a link on itEva Simone
August 5, 2022 at 5:35 am #1360722Hey evas49,
Thank you for the inquiry.
Are you using the Blog Posts element? Which blog style did you choose? Please provide a link to the site so that we can check the elements properly.
You can try this css code to disable the link of the featured image (big preview).
.big-preview.single-big a { pointer-events: none; }
Best regards,
IsmaelAugust 5, 2022 at 9:27 am #1360736it is not usefull to start double postings here : https://kriesi.at/support/topic/remove-link-from-featured-image-2/
August 5, 2022 at 10:50 am #1360758Hey!
Thank you for the info @Guenni007.
I tested the filter on my end and it seems to break the layout of the post, pushing the image outside of the big-preview container.
code from: https://kriesi.at/support/topic/remove-link-from-featured-image-2/
function av_remove_featured_image_link(){ if(is_single()){ echo get_the_post_thumbnail( $current_post['the_id'], 'featured' ); } } add_filter('avf_post_featured_image_link','av_remove_featured_image_link');
I adjusted the code a bit.
function av_remove_featured_image_link($image) { if (is_single()) { $image = get_the_post_thumbnail( $current_post['the_id'], 'featured' ); } return $image; } add_filter('avf_post_featured_image_link','av_remove_featured_image_link', 10, 1);
This returns the same markup or image which still contains a link as expected. This is due to this markup in the loop-index.php file.
iif( $slider ) { if( $link_lightbox ) { $slider = '<a ' . $lightbox_attr . ' ' . $featured_img_title . '>' . $slider . '</a>'; } else { $slider = '<a href="' . $link . '" ' . $featured_img_title . '>' . $slider . '</a>'; } } if( $slider ) { echo '<div class="big-preview ' . $blog_style . '" ' . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ) . '>' . $slider . '</div>'; }
We can slightly edit the code above to remove the link completely,
iif( $slider ) if( $slider ) { echo '<div class="big-preview ' . $blog_style . '" ' . avia_markup_helper( array( 'context' => 'image', 'echo' => false ) ) . '>' . $slider . '</div>'; }
Or just use the css suggestion above.
Best regards,
IsmaelAugust 5, 2022 at 11:50 am #1360780@guenni
it was a mistake, probably to the fact that the forum didnt load when i was trying to post and got a “500”
So i used the browsers return button and clicked again on “Submit”
I didnt realize that there was a double post@all
It does not make a difference which blogstyle i use (standard, elegent or modern business) – its always linked.
I am using a page with “masonry element” to pull the blogposts but why should this affect how a single blopgost looks like?Eva Simone
The only code that removed the link was the first one.
But it downsized the featured image to 645px width so that it does not fit correctly into the page width.
The other two php codes did not change anything.Here is the code from my post:
[av_textblock textblock_styling_align='' textblock_styling='' textblock_styling_gap='' textblock_styling_mobile='' size='' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' font_color='' color='' id='' custom_class='' template_class='' av_uid='av-8wuey' sc_version='1.0' admin_preview_bg=''] TEXT [/av_textblock] [av_content_slider heading='Bilder & Infos' navigation='dots' columns='1' margin='' margin_sync='true' padding='' padding_sync='true' font_color='' color='' background_color='' bg_color='#ffffff' gradient_color_direction='vertical' gradient_color_1='#000000' gradient_color_2='#ffffff' gradient_color_3='' border='' border_width='' border_width_sync='true' border_color='' border_radius='' border_radius_sync='true' box_shadow='' box_shadow_style='0px,0px,0px,0px' box_shadow_color='' heading_tag='' heading_class='' animation='slide' autoplay='true' interval='5' id='' custom_class='infoslider' template_class='' av_uid='av-l6f475fx' sc_version='1.0'] [av_content_slide title='' heading_tag='' heading_class='' link='' linktarget='' av_uid='av-l6f46bbv' sc_version='1.0'] [nggallery id=120] [/av_content_slide] [av_content_slide title='' heading_tag='' heading_class='' link='' linktarget='' av_uid='av-l6f45rf4' sc_version='1.0'] [av_one_half first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' link='' linktarget='' link_hover='' padding='0px' border='' border_color='' radius='0px' background='bg_color' background_color='' background_gradient_color1='' background_gradient_color2='' background_gradient_direction='vertical' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_breaking='' mobile_display='' custom_class='spalteeins' av_uid='av-72q5dr'] [av_textblock size='' font_color='' color='' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' admin_preview_bg='' av_uid='av-6979hr']Kontakt: DATA [/av_textblock] [/av_one_half] [av_one_half min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' link='' linktarget='' link_hover='' padding='0px' border='' border_color='' radius='0px' background='bg_color' background_color='' background_gradient_color1='' background_gradient_color2='' background_gradient_direction='vertical' src='' background_position='top left' background_repeat='no-repeat' animation='' mobile_breaking='' mobile_display='' custom_class='spaltezwei' av_uid='av-4g6q8f'] [av_textblock size='' font_color='' color='' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' admin_preview_bg='' av_uid='av-32ylxr']Infos: MORE DATA [/av_textblock] [/av_one_half] [/av_content_slide] [/av_content_slider]
Do you need anything more?
I unfortunately cant show you the issue live cause i am on Xampp- This reply was modified 2 years, 3 months ago by evas49. Reason: gave more infos
August 5, 2022 at 7:07 pm #1360852ok – thanks Ismael – on my testinstallation this code works.
this will immediately be added to my large collection of snippets.And thanks – i did not see that i missed one closing curly bracket ! -Sorry
But i thought that the link function has to be hampered – and not redefine the image source for that image.
Both could be done by echo that new image definition:function av_remove_featured_image_link($image) { if (is_single()) { $image = get_the_post_thumbnail( $current_post['the_id'], 'featured' ); } // return : if you only want to have a different image source for that f.e. : entry_with_sidebar echo $image; } add_filter('avf_post_featured_image_link','av_remove_featured_image_link', 10, 1);
and if you choose a different image-size source for this image it might be good to shift the image again to the center of its container:
( but even here there are a lot of possible selectors depending on the blog settings ).template-single-blog .wp-post-image { position: relative; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
August 7, 2022 at 7:14 am #1360970But:
It does not make a difference which blogstyle i use (standard, elegent or modern business) – its always linked.
I am using a page with “masonry element” to pull the blogposts but why should this affect how a single blopgost looks like?on the other posting you are talking about the single posts. So this code has no influence on this link.
there I think in a blog it makes sense to also link the image to the single post.look to : https://kriesi.at/support/topic/remove-link-from-featured-image-3/#post-1360722 to only remove the mouse action – ( but : you had to adjust the selector on different blog-styles etc. )
.slide-entry .slide-image, .post-entry .small-preview, .post-entry .big-preview a { pointer-events: none; }
or you had to edit the loop … ( with all its blog-style cases )
August 17, 2022 at 11:34 am #1361912@guenni007 – Yes, it is about posts.
It was Ismael , not me, who asked about the Blogstyle:”Which blog style did you choose? ”
But the blogstyle does not have any influence on if the featured image is linked or not.
Again – i am talking only about the feautured image in a single post.@all
There is still another thing unanswered from my first post:
“And this also:
I use nextgengallery
When i click an image from the gallery it opens twice – one time by the NGG-lightbox and behind it there is another lightbox – probably from Enfold.”
When i downgrade to an older version of Enfold it works like it should – only one lightbox.Eva Simone
August 17, 2022 at 4:10 pm #1361970Hi Eva Simone,
Can you try to go to Enfold > Theme Options, then disable Lightbox Modal Window and see if it helps.
Best regards,
Nikko -
AuthorPosts
- The topic ‘Remove link from featured image’ is closed to new replies.