davebowker
Forum Replies Created
-
+1
Forum: Fixing WordPress
In reply to: WP_Query, showing specific category breaks sticky postsSame problem. No fix yet?
Forum: Fixing WordPress
In reply to: Get 1 attachment per post from X category outside the loopHey vtxyzzy,
I tried the code above but couldn’t get it to work. What I ended up with was based off your suggestion of loop and loop again. This is the code I have now, and seems to work.
<?php query_posts('category_name=work&posts_per_page=10'); ?> <?php while (have_posts()) : the_post(); ?> <?php $args = array( 'order' => 'ASC', 'post_type' => 'attachment', 'post_parent' => $post->ID, 'post_mime_type' => 'image', 'post_status' => null, 'numberposts' => 1, ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { //echo apply_filters('post_title', $attachment->post_title); echo "<li><a href='"; echo the_permalink(); echo "' title='"; echo the_title(); echo "'>"; echo wp_get_attachment_image($attachment->ID, 'thumbnail', false, false); echo "</a></li>"; } } ?> <?php endwhile;?>
I’m not sure how fast it is or if it’s the best way to do it, but for now it works.
Cheers,
DaveForum: Fixing WordPress
In reply to: Get 1 attachment per post from X category outside the loopHey vtxyzzy,
Cheers for looking into this. Unfortunately so far it’s not working. I know your code was untested and produced an error when I ran it. I think this may be due to a missing ‘)’ on line 8 which I then added.
Upon trying again it ran without error, but returned no results. I’m not a hardcore PHP programmer, so you may be pretty much correct with your code apart from tweaking it slightly.
I did try that link when I first started to do this. That’s where I got the original code from. Anything more you can do to help would be greatly appreciated.
Cheers,
DaveForum: Fixing WordPress
In reply to: Display Post count with single TagThis is great for doing each tag individually, but how about if we wanted to display a tag cloud with the post count on each tag.
Example, Summer (4), Spring (19), Autumn (7), Winter (2) …etc…
I looked but there doesn’t seem to be a show_count option on the tags like there is on the categories.
Thanks.
Forum: Alpha/Beta/RC
In reply to: How to Add page based on Template in 2.7I’m having the same problem. I’ve made a page template, but it’s not showing up under attributes.
Has this feature made it into 2.7b3?
Forum: Fixing WordPress
In reply to: cannot login WP 201 (admin) running on XAMPP 2.1this post is pretty old but still having the same problem. it is definately some conflict with Zone Alarm but I’m not sure how to fix it. Was wondering is anyone succeeded or anyone knows a fix?