Move/Hide Post Images

Last Reviewed: 8-May-15 (3.3.23) 3.1.* 3.2.* 3.3.*

Customizr introduced built-in feature changes in v3.3. Go to Customize>Content>Post lists.

post_list_2

The following code supports v3.1/3.2

You may wish to adjust the positioning of the Images on Posts. Default is alternate Left/Right, but you can force all to Left or Right. This can be done by:

Where to copy/paste this code?
The simplest way is to use the Custom CSS section of the customizer option screen. If you have many customizations to make in CSS and PHP, then we strongly recommend you create a child theme. Everything you need to know about creating a child theme with Customizr here.

Hide Images:

/* START OF Move/Hide Post Images */
/* Thumbnail Removed */
.post .tc-thumbnail {
display:    none;
}
/* Reset Post position/width */
.post .tc-content {
margin-left: 0px;
min-width:  100%;
}
/* END OF Move/Hide Post Images */

 

Move all Images to Left:

/* START OF Move/Hide Post Images */
/* Thumbnail Left */
.post .tc-thumbnail {
float:      left;
/* margin-left: 0px; */
}
/* Post Content Right */
.post .tc-content {
float:      right;
}
/* END OF Move/Hide Post Images */

 

Move all Images to Right:

/* START OF Move/Hide Post Images */
/* Thumbnail right */
.post .tc-thumbnail {
float:      right;
}
/* Post Content left */
.post .tc-content {
float:      left;
}
/* END OF Move/Hide Post Images */

 

Since the Snippet was originally published, it has been identified that the CSS solution is not ‘pixel-perfect’.
@ElectricFeet has published an update using php which is a more accurate solution.

 

Where to copy/paste this code?
We strongly recommend you create a child theme and add this to the Child Theme functions.php.
Download a start-up child theme here.

Remember: you shouldn’t edit the theme’s functions.php.

 

Move all Images to Left:

// START OF Move/Hide Post Images 
// Moves post-list images to left.
add_filter( 'tc_post_list_layout', 'my_post_list_layout');
function my_post_list_layout() {
     return array(
    'content'           => 'span8',
    'thumb'             => 'span4',
    'show_thumb_first'  => true,
    'alternate'         => false
     );
}
// END OF Move/Hide Post Images

 

Move all Images to Right:

// START OF Move/Hide Post Images 
// Moves post-list images to right.
add_filter( 'tc_post_list_layout', 'my_post_list_layout');
function my_post_list_layout() {
     return array(
    'content'           => 'span8',
    'thumb'             => 'span4',
    'show_thumb_first'  => false,
    'alternate'         => false
     );
}
// END OF Move/Hide Post Images

3 thoughts on “Move/Hide Post Images”

Comments are closed.