Digital experiences for all disciplines
New Landing › How can we help? › Atelier › Magic fields thumbnail problem
New Landing › How can we help? › Atelier › Magic fields thumbnail problem
Tagged: #help #deadline #crying #hero
- This topic has 4 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Atelier
-
March 9, 2016 at 10:11 pm #254545
Hi there,
We have an issue and we hope you guys can help us! We recently are using Atelier as theme, but the website did had a other theme beforehand. The first theme used the plug-in ‘Magic fields 2’ for it’s ‘featured image’ within the posts. Nowadays we’re using Atelier and that’s why the ‘featured image’ aren’t shown anymore (900+ posts).
So the question is: Is it possible to get a codesnippet (or a other solution) for multiple files in your theme so the ‘featured image’ will be shown/installed from ‘Magic fields 2’? We would really like to use the original ‘featured image’ for future posts, because that is the way how it’s supposed to be used.
Extra info:
The property of the ‘featured image’ from the old theme is (from Magic Fields 2) is: meta_info_afbeelding. Screenshots in appendix.Thanks in advance!
Attachments:
You must be logged in to view attached files.March 10, 2016 at 10:23 am #254622Hi,
Please paste this code at functions.php of child theme:-function sf_post_detail_media() { global $post, $sf_options, $sf_sidebar_config; $single_author = $sf_options['single_author']; $remove_dates = $sf_options['remove_dates']; $bg_color_title = sf_get_post_meta( $post->ID, 'sf_bg_color_title', true ); $bg_opacity_title = sf_get_post_meta( $post->ID, 'sf_bg_opacity_title', true ); if ( !$bg_color_title ) { $bg_color_title = "transparent"; $bg_opacity_title = "0"; } $media_type = sf_get_post_meta( $post->ID, 'sf_media_type', true ); $fw_media_display = sf_get_post_meta( $post->ID, 'sf_fw_media_display', true ); $details_overlay_styling = ""; $details_overlay_color = sf_get_post_meta( $post->ID, 'sf_title_overlay_text_color', true ); if ( $details_overlay_color != "" ) { $details_overlay_styling = 'style="color: ' . $details_overlay_color . '"'; } $pb_active = sf_get_post_meta( $post->ID, '_spb_js_status', true ); $post_author = get_the_author_link(); $post_date = get_the_date(); $post_date_str = get_the_date('Y-m-d'); $post_categories = get_the_category_list( ', ' ); if ( $media_type == "none" ) { return; } if ( is_singular('directory') ) { $fw_media_display = "standard"; } if ( $fw_media_display == "fw-media-title" && $media_type != "none" ) { remove_action( 'sf_post_article_start', 'sf_post_detail_heading', 0 ); $use_thumb_content = sf_get_post_meta( $post->ID, 'meta_info_afbeelding', true ); $custom_media_height = sf_get_post_meta( $post->ID, 'sf_media_height', true ); $media_height = null; if ( $custom_media_height != "" ) { $media_height = $custom_media_height; } else { $custom_media_height = 0; } $image_url = sf_image_post( $post->ID, 1920, $media_height, $use_thumb_content, true ) ?> <div class="detail-feature" style="background-image: url(<?php echo esc_url($image_url); ?>); min-height: <?php echo esc_attr($custom_media_height); ?>px;"> <span class="media-overlay" style="background-color:<?php echo $bg_color_title; ?>;opacity:<?php echo ( $bg_opacity_title / 100 ); ?>;"></span> <div class="details-overlay"> <h1 class="entry-title" itemprop="name" <?php echo $details_overlay_styling; ?>><?php the_title(); ?></h1> <?php if ( $single_author && ! $remove_dates ) { ?> <div class="post-item-details" <?php echo $details_overlay_styling; ?>><?php echo sprintf( __( 'In %1$s on <time datetime="%2$s" itemprop="datePublished" class="updated">%3$s</time>', 'swiftframework' ), $post_categories, $post_date_str, $post_date ); ?></div> <?php } else if ( ! $remove_dates ) { ?> <div class="post-item-details" <?php echo $details_overlay_styling; ?>><?php echo sprintf( __( '<span class="vcard author">By <span itemprop="author" class="fn">%1$s</span></span> in %2$s <time class="date updated" datetime="%3$s" itemprop="datePublished">%4$s</time>', 'swiftframework' ), $post_author, $post_categories, $post_date_str, $post_date ); ?></div> <?php } else if ( ! $single_author ) { ?> <div class="post-item-details" <?php echo $details_overlay_styling; ?>><?php echo sprintf( __( '<span class="vcard author">By <span itemprop="author" class="fn">%1$s</span></span> in %2$s', 'swiftframework' ), $post_author, $post_categories ); ?></div> <?php } ?> </div> </div> <?php } else if ( $fw_media_display == "fw-media" ) { sf_get_template( 'detail-media' ); } else if ( ( $pb_active != "true" && !$fw_media_display == "standard" ) ) { ?> <?php sf_get_template( 'detail-media' ); ?> <?php } else { ?> <div class="container"> <?php sf_get_template( 'detail-media' ); ?> </div> <?php } }?>
Thanks
MohammadMarch 10, 2016 at 8:02 pm #254808Thank you for submitting the snippet :). We’ve tried to paste the snippet in serveral places in functions.php but it didn’t work. Are you sure the snippet is correct?
Maybe we have misplaced it, because we’re not familiar with the code. Can you tell us where we have to place the snippet?
Is it possible that you guys place the snippet for us? That would be very much appreciated! ๐
Here’s a link to our blog page where the featured images should be shown as needed.
Link: http://ktc.designkapitein.nl/nieuws-ktc/Thanks in advance Mohammed! ๐
March 11, 2016 at 12:12 pm #254908Hi Mohammed/Swift guys and girls,
We don’t want to bother you to much, but we happen to have a important deadline monday. This is the last thing we have to do to complete the website! Can and will you be our hero and be displayed in our ‘alltime hall of fame?’
Thanks and much love ๐
March 14, 2016 at 1:27 pm #255230Hi there,
It’s not within the scope of our support to be able to provide that functionality as it is more work than a small customisation. While we’d love to be able to support every customisation request, we simply don’t have the time.
We recommend that you seek a freelance developer if you need that functionality:
Thanks.
-
Posted in: Atelier
You must be logged in and have valid license to reply to this topic.