Rob Cubbon
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: search not-singular search-no-results showing in search resultsThe problem only occurs when only one search result is returned.
It’s OK when their are multiple results or when there are no results!
Forum: Fixing WordPress
In reply to: Two different sizes of thumbnailsI’ve just found a way round it.
When I’d specifically created a 150px square image for the main post thumbnail and uploaded it; WP uses that 150px x 150px image to make the new thumbnail. Where I’d chosen an image of another size from the media library and used the 150px square version that it created for the main thumbnail; WP uses the original image from the media library to make the new sized thumbnail which is why they came in all shapes and sizes.
So I have just made sure that the last few posts have proper specifically uploaded square thumbnails and that makes the secondary size of thumbnails square.
Confused? I am.
Forum: Fixing WordPress
In reply to: Two different sizes of thumbnailsThis seems to work better:
<ul> <?php $my_query = new WP_Query('showposts=10'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><?php the_post_thumbnail('my_thumbnail'); ?></li> <li><a href="<?php the_permalink() ?>" ><?php the_title(); ?></a></li> <?php endwhile; ?> </ul>But, it’s funny, sometimes it takes the 150px x 150px post thumbnail and resizes it to 50px x 50px and sometimes it take the first image from the post and resizes it to 50px wide by whatever the proportionate height. So it ignores some specified thumbnails!?
Forum: Fixing WordPress
In reply to: Two different sizes of thumbnailsThank you, SteelFrog.
I’m having trouble implementing it on my custom page. I’ve put this after the loop which I’ve adapted from a bit of PHP from my sidebar that lists my last 10 posts.
It doesn’t show the thumbnails and has the permalinks and titles wrong – it returns the permalink (?n – not pretty) and title of the page you are on.
<ul> <?php $myposts = get_posts('numberposts=10'); foreach($myposts as $post) : ?> <li> <?php the_post_thumbnail('my_thumbnail'); ?> <a href="<?php the_permalink(); ?>"><?php the_title();?></a></li> <?php endforeach; ?> </ul>And when I put it in the sidebar the list of posts are OK but the new thumbnails are all of the post you are on rather than the post it is next to in the list.
It looks like the thumbnail call should have the post id on it?
Forum: Fixing WordPress
In reply to: Batch changing url and image paths in WordPress sitet31os_ thanks for the recommendation – sorry didn’t see the reply for this two months ago. I didn’t have the courage to do this as I’d read that it can cause DB problems so changed them all manually.
Forum: Fixing WordPress
In reply to: Get thumbnails to link to the single post they refer toWell done, RV, you’re way ahead of me. I’ve spent many hours with my nose in the codex without getting so much as a sniff!
Thanks again 🙂
Forum: Fixing WordPress
In reply to: Get thumbnails to link to the single post they refer toBeautiful! Thank you very much, RVoodoo, I just whacked it in:
echo '<a href="'. get_permalink() . '"> <img src="/images/default-thumbnail.jpg" alt="Default Thumbnail" /></a>';And it works a treat. Well done! Maybe one day all this will make sense to me 🙂
Forum: Fixing WordPress
In reply to: Get thumbnails to link to the single post they refer toI’ve tried that and a few other things – maybe you just can’t have PHP inside an echo?
Thanks for trying
Forum: Fixing WordPress
In reply to: Get thumbnails to link to the single post they refer toThanks, I’m trying stuff like:
echo '<a href="the_permalink()"><img src="/images/default-thumbnail.jpg" alt="Default Thumbnail" /></a>';but it really doesn’t work.
Forum: Fixing WordPress
In reply to: Get thumbnails to link to the single post they refer toThanks RVoodoo, I don’t believe I missed that as I was reading Justin Tadlock’s piece. It would be great now if I could find away of linking the default thumbnail image. I’ve tried:
<?php if ( has_post_thumbnail() ) the_post_thumbnail(array(150, 150)); else echo '<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <img src="/images/default-thumbnail.jpg" alt="Default Thumbnail" /> </a>'; ?>But it didn’t work.
Forum: Plugins
In reply to: [Plugin: Twitter for WordPress] No public Twitter messagesIt’s not a fix but another way of doing it without the plugin – http://remysharp.com/2007/05/18/add-twitter-to-your-blog-step-by-step/
works for me.
Forum: Plugins
In reply to: [Plugin: Twitter for WordPress] No public Twitter messagesHas anyone sorted this one out? It’s driving me mad. We’ve got “No public Twitter messages” 90% of the time. Have tried Don Salva’s fix, jmharris903’s and tvarne’s. No go.
Forum: Fixing WordPress
In reply to: single.php displays all posts, archive.php displays all categoriesYes, I can understand what you’re saying. It looks to me that you shouldn’t use the function query_posts() outside the loop.
The problem was I pasted that bit of code in the sidebar a few weeks ago. I probably just googled “list posts wordpress” and put the first thing that came up and because it seemed to work with just one post I’d forgotten about it!
Thanks again. I learn a little bit more about WordPress every time something like this happens.
Forum: Fixing WordPress
In reply to: single.php displays all posts, archive.php displays all categoriesI did tell you I was thick. There was a problem in the sidebar. To list the posts I’d put this:
<?php query_posts('showposts=5'); ?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endwhile;?> </ul>I don’t know where I’d got that from. But it looks wrong. It’s opened a loop without closing it?
I’ve just substituted it for this
<ul> <?php wp_get_archives('title_li=&type=postbypost&limit=10'); ?> </ul>and now it works.
I’m sorry, I hadn’t thought that something in the sidebar could affect single.php and archive.php like that. This is a result of not knowing much, just getting bits and bobs from everywhere and putting them together hoping they’ll work.
Thank you for this. It was interesting to see your problem-solving process but I really apologize for not thinking of this stupid bit of code I’d put in the sidebar.
Forum: Fixing WordPress
In reply to: single.php displays all posts, archive.php displays all categoriesyes, vtxyzzy