Tagged: featured images
- This topic has 4 replies, 3 voices, and was last updated 8 years, 1 month ago by Theme Horse Support Team.
-
AuthorPosts
-
October 6, 2016 at 7:15 am #47428jonasParticipant
Hi,
I have had a fully working homepage with featured imiges to each page made but after the last update I som how manage to lose the contact between the featured image and the homepage. I have tried to switch to another theme and then the images are uploaded but not using interface theme. Please help! Is there a special box I need to tick off in order to get the images uploaded?
please check out the homepage http://www.m2d.se
October 6, 2016 at 2:15 pm #47445Theme Horse Support TeamKeymasterHi Jonas,
Sorry! There is no any issue in the featured images you set to the pages and the contact between the home page.
May some of the plugin conflict the code and broke the contact between between the featured image and the homepage. Anyways you can set the image and the home page again. If there is again the same issue please let us know.Thank you for using our theme.
October 7, 2016 at 10:17 am #47467jonasParticipantHi,
Thank you for the reply. I had to solvve the problem temporary by making a “child” file of the “Content-leftbar.php” by adding the following code in the end.
“<div id=”secondary” class=”no-margin-left”>
<?php get_sidebar( ‘left’ ); ?>
<?php the_post_thumbnail(‘normal_thumbnail’); ?></div>”
This should not be needed and is not a good solutioin since I needed to redifine everything in the functioin.php
Do you have any suggestions on a better solution? I can still not get images in my post site this only solves it for my pages.
see: http://www.wordpress.m2d.se/news/Thank you!
If you need more information pleas let me know and I will try to provied it 🙂October 10, 2016 at 2:42 am #47508Theme Horse Support TeamKeymasterHi jonas,
Yes the featured image will not be displayed on Page. Featured image are designed to display only on home page or on blog page. We have designed our theme this way. It was from the beginning from version 1.0. You told that after your last update your featured image is lost. That means you have customized a code on the theme. If you make direct code customization on the theme then while updating to new version all your customized code will be lost. So we recommended you not to change any code on the parent theme. Customize any thing on the child theme.GO to theme folder -> inc -> structure -> content-extension.php on line no 215 you will find this code
<article>
Add below code just below<article>
tagif( has_post_thumbnail() ) { $image = ''; $title_attribute = the_title_attribute( array( 'echo' => false ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .='<span class="arrow"></span>'; $image .= '</figure>'; echo $image; }
Remember create a child theme and then customize the code. Otherwise if there is a change on the code then the above code must be added each and every time when you update to latest version.
Add below code on your functions.php
<?php // Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'interface_loop_content', 'interface_theloop', 10 ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook interface_header add_action( 'interface_loop_content', 'interface_child_loop_content' ); function interface_child_loop_content() { if( is_page() ) { if( is_page_template( 'page-templates/page-template-blog-image-large.php' ) ) { interface_theloop_for_template_blog_image_large(); } elseif( is_page_template( 'page-templates/page-template-blog-image-medium.php' ) ) { interface_theloop_for_template_blog_image_medium(); } elseif( is_page_template( 'page-templates/page-template-blog-full-content.php' ) ) { interface_theloop_for_template_blog_full_content(); } else { interface_child_theloop_for_page(); } } elseif( is_single() ) { interface_child_theloop_for_single(); } elseif( is_search() ) { interface_child_theloop_for_search(); } else { interface_child_theloop_for_archive(); } } /****************************************************************************************/ /****************************************************************************************/ if ( ! function_exists( 'interface_child_theloop_for_archive' ) ) : /** * Fuction to show the archive loop content. */ function interface_child_theloop_for_archive() { global $post; if( have_posts() ) { while( have_posts() ) { the_post(); do_action( 'interface_before_post' ); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( 'interface_before_post_header' ); ?> <article> <?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = the_title_attribute( array( 'echo' => false ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .='<span class="arrow"></span>'; $image .= '</figure>'; echo $image; } ?> <header class="entry-header"> <?php if (get_the_author() !=''){?> <div class="entry-meta"> <span class="cat-links"> <?php the_category(', '); ?> </span><!-- .cat-links --> </div> <?php } ?> <!-- .entry-meta --> <h2 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"> <?php the_title();?> </a> </h2> <!-- .entry-title --> <?php if (has_category() !=''){?> <div class="entry-meta clearfix"> <div class="by-author vcard author"><span class="fn"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php esc_attr(the_author()); ?>"> <?php the_author(); ?> </a></span></div> <div class="date updated"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"> <?php the_time( get_option( 'date_format' ) ); ?> </a></div> <?php if ( comments_open() ) { ?> <div class="comments"> <?php comments_popup_link( __( 'No Comments', 'interface' ), __( '1 Comment', 'interface' ), __( '% Comments', 'interface' ), '', __( 'Comments Off', 'interface' ) ); ?> </div> <?php } ?> </div> <!-- .entry-meta --> </header> <!-- .entry-header --> <div class="entry-content clearfix"> <?php the_excerpt(); ?> </div> <!-- .entry-content --> <footer class="entry-meta clearfix"> <span class="tag-links"> <?php $tag_list = get_the_tag_list( '', __( ' ', 'interface' ) ); if(!empty($tag_list)){ echo $tag_list; }?> </span><!-- .tag-links --> <?php echo '<a class="readmore" href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'.__( 'Read more', 'interface' ).'</a>'; ?> </footer> <!-- .entry-meta --> <?php } else { ?> </header> <?php the_content(); } ?> </article> </section> <!-- .post --> <?php do_action( 'interface_after_post' ); } } else { ?> <h2 class="entry-title"> <?php _e( 'No Posts Found.', 'interface' ); ?> </h2> <?php } } endif; /****************************************************************************************/ if ( ! function_exists( 'interface_child_theloop_for_page' ) ) : /** * Fuction to show the page content. */ function interface_child_theloop_for_page() { global $post; if( have_posts() ) { while( have_posts() ) { the_post(); do_action( 'interface_before_post' ); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article> <?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = the_title_attribute( array( 'echo' => false ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .='<span class="arrow"></span>'; $image .= '</figure>'; echo $image; } do_action( 'interface_before_post_header' ); ?> <?php do_action( 'interface_after_post_header' ); ?> <?php do_action( 'interface_before_post_content' ); ?> <div class="entry-content clearfix"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'interface' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '%', 'echo' => 1 ) ); ?> </div> <!-- entry-content clearfix--> <?php do_action( 'interface_after_post_content' ); do_action( 'interface_before_comments_template' ); comments_template(); do_action ( 'interface_after_comments_template' ); ?> </article> </section> <?php do_action( 'interface_after_post' ); } } else { ?> <h2 class="entry-title"> <?php _e( 'No Posts Found.', 'interface' ); ?> </h2> <?php } } endif; /****************************************************************************************/ if ( ! function_exists( 'interface_child_theloop_for_single' ) ) : /** * Fuction to show the single post content. */ function interface_child_theloop_for_single() { global $post; if( have_posts() ) { while( have_posts() ) { the_post(); do_action( 'interface_before_post' ); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article> <?php if( has_post_thumbnail() ) { $image = ''; $title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) ); $image .= '<figure class="post-featured-image">'; $image .= '<a href="' . get_permalink() . '" title="'.the_title( '', '', false ).'">'; $image .= get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ) ) ).'</a>'; $image .='<span class="arrow"></span>'; $image .= '</figure>'; echo $image; } ?> <header class="entry-header"> <?php if(get_the_time( get_option( 'date_format' ) )) { ?> <div class="entry-meta"> <span class="cat-links"> <?php the_category(', '); ?> </span><!-- .cat-links --> </div> <!-- .entry-meta --> <h2 class="entry-title"> <?php the_title();?> </h2> <!-- .entry-title --> <div class="entry-meta clearfix"> <div class="by-author vcard author"><span class="fn"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php esc_attr(the_author()); ?>"> <?php the_author(); ?> </a></span></div> <div class="date updated"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( get_the_time() ); ?>"> <?php the_time( get_option( 'date_format' ) ); ?> </a></div> <?php if ( comments_open() ) { ?> <div class="comments"> <?php comments_popup_link( __( 'No Comments', 'interface' ), __( '1 Comment', 'interface' ), __( '% Comments', 'interface' ), '', __( 'Comments Off', 'interface' ) ); ?> </div> <?php } ?> </div> <!-- .entry-meta --> </header> <!-- .entry-header --> <?php } ?> <div class="entry-content clearfix"> <?php the_content(); wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'interface' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', 'pagelink' => '%', 'echo' => 1 ) ); ?> </div> <?php if(get_the_time( get_option( 'date_format' ) )) { ?> </header> <?php } ?> <!-- entry content clearfix --> <?php if( is_single() ) { $tag_list = get_the_tag_list( '', __( ' ', 'interface' ) ); if( !empty( $tag_list ) ) { ?> <footer class="entry-meta clearfix"> <span class="tag-links"> <?php echo $tag_list;?> </span><!-- .tag-links --> </footer> <!-- .entry-meta --> <?php } do_action( 'interface_after_post_content' ); } do_action( 'interface_before_comments_template' ); comments_template(); do_action ( 'interface_after_comments_template' ); ?> </article> </section> <!-- .post --> <?php do_action( 'interface_after_post' ); } } else { ?> <h2 class="entry-title"> <?php _e( 'No Posts Found.', 'interface' ); ?> </h2> <?php } } endif; /****************************************************************************************/ if ( ! function_exists( 'interface_child_theloop_for_search' ) ) : /** * Fuction to show the search results. */ function interface_child_theloop_for_search() { global $post; if( have_posts() ) { while( have_posts() ) { the_post(); do_action( 'interface_before_post' ); ?> <section id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <article> <?php do_action( 'interface_before_post_header' ); ?> <header class="entry-header"> <h2 class="entry-title"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute();?>"> <?php the_title(); ?> </a> </h2> <!-- .entry-title --> </header> <?php do_action( 'interface_after_post_header' ); ?> <?php do_action( 'interface_before_post_content' ); ?> <div class="entry-content clearfix"> <?php the_excerpt(); ?> </div> <?php do_action( 'interface_after_post_content' ); ?> </article> </section> <?php do_action( 'interface_after_post' ); } } else { ?> <h2 class="entry-title"> <?php _e( 'No Posts Found.', 'interface' ); ?> </h2> <?php } } endif; ?>
If you need any code customization then you have to do under child theme functions.php not on the main theme.
Thank you
October 10, 2016 at 2:44 am #47509Theme Horse Support TeamKeymasterIf there is no any code customization then also install a fresh theme downloaded from wordpress.org
Thank you
-
AuthorPosts
- You must be logged in to reply to this topic.