Why cannot show WP post images on category page?
-
Hello, I am stuck here and I really need some help. I have created WP site and applied a theme to it. I have made a lot of editing and propagation to it but I am stuck with a bug that I cannot fix for over 2weeks of searching and trials now. The site is created as an eCommerce one and I needed to create a blog into it and I wanted to make it appear into the same design. So, I changed the home page design and made it looks like a normal site without any blogs there. Added posts and every thing internally and added them all to one category called "Blog" and linked to that category as the main blog page so that it shows all posts as an internal blog. The problem now is that the images does not show, atlhough in the template I have a category.php file and I edited it to shows the thumbnails. --------------------------------------… <?php if ( has_post_thumbnail()) : ?> <?php echo '<figure class="thumb">'; the_post_thumbnail(); echo '</figure>'; /* loades the post's featured thumbnail, requires Wordpress 3.0+ */ ?> <?php endif; ?> <div class="heading"> <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php $title = the_title('','', false); if ($title != '') echo $title; else _e("Article",'mazine'); ?></a></h2> <div class="post-meta-written"> <?php the_time('F j, Y'); ?> <?php echo __('at','mazine'); ?> <?php the_time() ?>, <?php echo __('by','mazine'); ?> <?php the_author_posts_link() ?> </div> </div> <div class="post-content"> <?php the_excerpt(__(' Read more','mazine'));?> </div> <div class="post-meta"> <div class="post-meta-taxonomy"> <b><?php echo __('Categories','mazine'); ?>:</b> <?php the_category(', ') ?><br/> <?php if (the_tags(__('<b>Tags:</b> ', 'mazine'), ', ', ' ')); ?> </div> <div class="post-meta-comments"> <?php comments_popup_link(__('No Comments','mazine'), __('1 Comment','mazine'), __('% Comments','mazine')); ?> </div> </div><!--.postMeta--> </article> --------------------------------------… I found that if the same code was added to the index page, all images will show properly. I tried editing and plugins and but that did not fix it. Any suggestions?
-
Answer:
Try using Wordpress feature image. Add this to your functions.php file: if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); } Here is more info about that: http://codex.wordpress.org/Post_Thumbnails Then where you want to use the image in your template, put this: <?php the_post_thumbnail('thumbnail'); ?> That is for the thumbnail size, but you can use medium or large and it will use the size you've set in Wordpress under Settings > Media.
ramize at Yahoo! Answers Visit the source
Related Q & A:
- Why i cannot open any images in the yahoo pages?Best solution by Yahoo! Answers
- Why do people slice up images created in Adobe Photoshop CS3 or Illustrator for web pages?Best solution by Yahoo! Answers
- How Do I Show My Avatar On My Email Page?Best solution by Yahoo! Answers
- Why can't I view images in some of my emails?Best solution by Yahoo! Answers
- Why can't I upload images to websites?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.