PHP/ WordPress Help Please

Hello:

I have customized my WP theme to show thumbnails of each post in a category. Here is an example, http://www.corbettcartoons.com/?cat=17.

I now want to add a small caption under each thumbnail and I am not sure if I have to modify the php from the defaultindex.php file or can I do it some other way like in the wp admin.

This Cat Display is modified using this code here but I am not sure I can echo anything under each post.

<span style="width:600px; height:auto; padding:20px;">        
                        <?php $thumb = '';        
                              $width = 100;
                              $height = 100;
                              $classtext = 'no_border';
                              $titletext = get_the_title();
                            
                              $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
                              $thumb = $thumbnail["thumb"]; ?>
                        <?php if (get_option('grungemag_thumbnails') == 'false' && get_option('grungemag_blog_style')=='on') $thumb = ''; ?>
                        
                        <?php if($thumb != '') { ?>
                                <a href="<?php the_permalink() ?>" class="p1" title="<?php printf(__('Permanent Link to %s','GrungeMag'), get_the_title()) ?>">
                                    <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
                                <b><?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, 200, 200, 'large'); ?></b></a>
                            </span>
                        <?php }; ?>
            </span>

Any thoughts or help on this would be a great help,

Paul

ok nevermind… I fixed it.

It was a padding issue.

thanks again guys…

So basically, what I did was this,

<?php if($thumb != '') { ?>
                                <a href="<?php the_permalink() ?>" class="p1" title="<?php printf(__('Permanent Link to %s','GrungeMag'), get_the_title()) ?>">
                                    <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
                  <?php printf(__('%s','GrungeMag'), get_the_title()) ?>
                                <b><?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, 200, 200, 'large'); ?></b></a>
                            </span>
                        <?php }; ?>
            </span>

I inserted the code - <?php printf(__(‘%s’,‘GrungeMag’), get_the_title()) ?>

right under the thumb.

You can see how it turned out at this link here - http://www.corbettcartoons.com/?cat=17

As you can see, it did what I wanted but the last two cartoons are pushed down a bit and the white space does not sit right.

Can I possibly put this in a span to get this to work the way I want?

Thanks for any additional help on this,

Paul

Im not sure about your question, What you rely need to be modified , let me know I will try to help you…

Thanks everyone for your help and input on this, I have to dig in with your examples and see what I come up with.

Thanks again.

Paul

As far as I know, if you need to modify your category list, you should have to modify sidebar.php in your current theme.

For exmaple, if you need to show your pics in category so you have to add you pics in category function in sidebar.php

It quite easy to do :smiley:

You should be able to insert a statement just before the end of the span tag (see below):

<span style="width:600px; height:auto; padding:20px;">        
                        <?php $thumb = '';        
                              $width = 100;
                              $height = 100;
                              $classtext = 'no_border';
                              $titletext = get_the_title();
                            
                              $thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext);
                              $thumb = $thumbnail["thumb"]; ?>
                        <?php if (get_option('grungemag_thumbnails') == 'false' && get_option('grungemag_blog_style')=='on') $thumb = ''; ?>
                        
                        <?php if($thumb != '') { ?>
                                <a href="<?php the_permalink() ?>" class="p1" title="<?php printf(__('Permanent Link to %s','GrungeMag'), get_the_title()) ?>">
                                    <?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, $classtext); ?>
                                <b><?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, 200, 200, 'large'); ?></b></a>
<!--THIS PART RIGHT BELOW HERE-->
			<p><?php printf(__('Permanent Link to %s','GrungeMag'), get_the_title()) ?></p>
                            </span>
                        <?php }; ?>
            </span>

That will display (in a p tag) the same thing as the “title” attribute in the anchor tag above.

If I have understood what you are trying to do, you should first need to add a custom field first for caption if you dont want to use the title as the caption. Then add any html tag (possibly a div or p) after print thumbnail and write some CSS to fit it just below the thumbnail.