Support » Theme: JustWrite » Changing behavior/appearance of featured images in posts

  • Resolved tf5_bassist

    (@tf5_bassist)


    I’m looking to do a few things to the way a featured image is displayed in single posts:

    • Make image span the width of the post content itself instead of be a small thumbnail-type image
    • Make image clickable to open into a lightbox view for a larger view of the image

    And seeing as no other themes I’ve used have the “display thumbnail/don’t display thumbnail” option to show the featured image, is there a way to enable this globally to get all posts to show without cycling through each post individually?

    Thanks! 😀

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author acosmin

    (@acosmin)

    Hi! I’ll answer your question on Monday or Tuesday… Please be patient 🙂 it’s Sunday!

    Theme Author acosmin

    (@acosmin)

    1. CSS to make it full width:

    .single-template-1 .featured-image-wrap {
        width: 100% !important;
        margin: 35px 0 35px 0 !important;
        -webkit-box-shadow:none !important;
        -moz-box-shadow:none !important;
        box-shadow:none !important;
    }

    2. Not possible with the current code. You can hire someone to do this for you, try http://fiverr.com/

    3. In your child theme or theme function.php file at the bottom, add this code:

    remove_action( 'ac_single_post_title_info_thumb', 'ac_single_post_thumb' );
    
    function ac_single_post_new_thumb() {
    		global $paged;
    		$show_thumbnail = get_post_meta( get_the_ID(), 'ac_show_post_thumbnail', true );
    
    			do_action( 'ac_single_post_thumbnail_before' );
    			?>
    			<figure class="featured-image-wrap">
    				<?php
    				do_action( 'ac_single_post_thumbnail_before_image' );
    				if ( has_post_thumbnail() && $paged == false ) :
    					the_post_thumbnail( 'ac-sidebar-featured' );
    				else :
    					echo '<img src="' . get_template_directory_uri() . '/images/no-thumbnail.png" alt="' . __( 'No Thumbnail', 'justwrite' ) . '" />';
    				endif;
    				do_action( 'ac_single_post_thumbnail_after_image' );
    				?>
    			</figure>
    			<?php
    			do_action( 'ac_single_post_thumbnail_after' );
    }
    add_action( 'ac_single_post_title_info_thumb', 'ac_single_post_new_thumb', 20 );
    Thread Starter tf5_bassist

    (@tf5_bassist)

    Awesome, thanks! 😀

    Theme Author acosmin

    (@acosmin)

    I am marking this as resolved 😉 If you ever have the time, please consider leaving a review.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing behavior/appearance of featured images in posts’ is closed to new replies.