How to show content image in standard blog format?
-
Here is my standard format blog codes. Currently, it uses featured image as main image in blog but I want content image to in blog. I am noob when it comes to coding. Please help me
<?php if(has_post_thumbnail()) { ?>
<div class=”entry-media blog-media”>
<?php the_post_thumbnail(‘blog-thumb’); ?>
</div> <!– END .entry-media –><?php } ?>
-
Well it appears to be checking if their is a post thumbnail then show it. Instead of the code <?php the_post_thumbnail(‘blog-thumb’); ?> you can replace it with <?php the_post_thumbnail(‘NEW-NAME’); ?>.
The issue is that you will have to find in your theme what the name of the thumbnails are and replace ‘NEW-NAME’ with it. This most likely will be in your functions.php file but again, it depends on your theme.
Thanks for helpming me out
ok, i’ve lookede thumb in my functions.php
this is i’ve gound
Theme Supports
/*———————————————————————————–*/
add_theme_support( ‘post-thumbnails’ );
add_theme_support( ‘automatic-feed-links’ );
add_editor_style();
add_theme_support( ‘custom-background’ );add_image_size( ‘iconbox-thumb’, 45, 45, true );
add_image_size( ‘gallery-thumb’, 220, 220, true );
add_image_size( ‘portfolio-thumb’, 460);
add_image_size( ‘portfolio-crop-thumb’, 460, 270, true );
add_image_size( ‘single-portfolio-image-small’, 600);
add_image_size( ‘single-portfolio-image-big’, 940);
add_image_size( ‘single-blog-image’, 640);So, what should I replace or add.
This is my aside format code.
<div class=”blog-aside”>
<?php echo the_content(); ?>
</div>It takes image from content but not clickable or there is no readmore.
I’ve added the code from it but it is not changing
I would start and the bottom and use the one that is giving you the result that you you want.
I’m not sure I understand what you are trying to do. The aside code has nothing to do with your original request correct?
Sorry for me being a silly. So, you are saying that replace blog-thumb by what result?
You are right. But aside shows content image in blog page. So, I thought something may be in there useful for me to solve what I am trying to do
Yes, you need to replace blog-thumb with one of the other like single-blog-image but ultimately, you are the one who has to be happy with the results so you can try any of the ones that you posted.
So the aside code is displaying the_content which is just the content. If you want to display other things you can display thumbnails, the excerpt, really anything but it appears that it is not related to your first question so unless I’m missing something you may be getting distracted from your original question.
Or Is there any way to to disable featured image in single blog post?
You can do anything really but I have to ask, what exactly are you wanting to do? Your questions seem to be going down a few different paths but if you are explicit in what you are trying to do, we may be able to help.
So go ahead and post a link to your site and say on this page, I want to show ____.
sorry for being so naive.I’ve looked it from different ways.Please ignore the previous posts.
So, here is what i want to do. I want to disable or hide the featured image in single blog post.Thank you
Ok. Could you post the code from the single.php so we could take a look?
<?php //get global prefix global $sr_prefix; global $query; if ($query) { $query = $query; } else { $query = $wp_query; } if (have_posts()) : while (have_posts()) : the_post(); $style = get_option($sr_prefix.'_blogstyle'); if (!$style) { $style = 'layout-fixed'; } $format = get_post_format(); if( false === $format ) { $format = 'standard'; } ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content blog-content clearfix"> <?php if( $format == 'standard' || $format == 'gallery' || $format == 'image' || $format == 'video' || $format == 'audio' ) { if($format == 'gallery') { get_template_part( 'includes/post-type', $format.'-single' ); } else { get_template_part( 'includes/post-type', $format ); } } ?> <div class="blog-left"> <?php if ( !get_option($sr_prefix.'_blogpostsdisabledate') ) { ?> <div class="blog-date"><span class="day"><?php the_time('d') ?></span><span class="month"><?php the_time('M') ?></span></div> <?php } ?> <?php if ( !get_option($sr_prefix.'_blogpostsdisabletype') ) { ?> <div class="blog-format"><span class="format-<?php echo $format; ?>"></span></div> <?php } ?> </div> <div class="blog-right"> <div class="blog-text"> <?php if( $format == 'standard' || $format == 'gallery' || $format == 'image' || $format == 'video' || $format == 'audio' || $format == 'aside' ) { the_content(); } else { get_template_part( 'includes/post-type', $format ); }?> </div> <?php if ( !get_option($sr_prefix.'_blogpostsdisabletags') ) { ?> <div class="blog-tags clearfix"><?php the_tags( '', '', ''); ?></div> <?php } ?> <?php if ( !get_option($sr_prefix.'_blogpostsdisableshare') ) { ?> <div class="share blog-share clearfix"> <div class="sharetitle"><h5><?php _e('Share this post', 'sr_Custom_theme'); ?></h5></div> <?php sr_sharebutton(); ?> </div> <?php } ?> <?php if ( !get_option($sr_prefix.'_blogpostsdisableauthorinfo') && get_the_author_meta('description') ) { ?> <div class="blog-author clearfix"> <div class="author-image"> <a>"><?php echo get_avatar( get_the_author_meta('user_email'), '40', '' ); ?></a> </div> <div class="author-bio"> <h5><?php _e('About the Author', 'sr_Custom_theme'); ?></h5> <p><?php the_author_meta('description'); ?></p> </div> </div> <?php } ?> </div> </div> <!-- END .entry-content --> </div> <!-- END .post-ID --> <?php if (get_option($sr_prefix.'_commentsblog') == 'enabled' && comments_open() && !post_password_required() ) { ?> <div id="comment-section" class="clearfix"> <?php comments_template( '', true ); ?> </div> <?php } ?> <?php endwhile; endif; ?>
[Code fixed by moderator]
Next time around, please use the code buttons when posting code –
https://codex.www.ads-software.com/Forum_Welcome#Posting_Code
ok
- The topic ‘How to show content image in standard blog format?’ is closed to new replies.