GhostPool
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From QueryGreat stuff, the images are now working.
With the sticky posts I need them to be part of the same loop because I only want a maximum of 4 posts displayed and I’m calling the loop in a slider.
Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From QueryThanks for all the help kz.
Unfortunately neither of those alternatives display the images. I don’t think the $attachment->ID is being parsed. Does the post ID need to be called somewhere – so it knows what attachment IDs to pull?
Where would I insert this relative to the other code? Does this only show sticky posts, because I want to show sticky posts at the top and then normal posts below just like in the main loop on the index page.
$sticky=get_option('sticky_posts'); query_posts('p=' . $sticky[0]); /* do stuff */ wp_reset_query();Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From QueryRight, I’ve sorted issue 2), I’m still working on 1) and 3) though. 🙂
Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From Querykz,
This looks really promising, it skips the posts with no images as I wanted.
Few issues though:
1) I can’t seem to get the images to display. The image URLs are being generated by <?php echo wp_get_attachment_url($attachment->ID); ?>.
2) How do I integrate a meta_value/meta_key filter?
3) Sticky posts no longer seem to show at the top of the loop.
Forum: Fixing WordPress
In reply to: Exclude Posts Without Attachments From QueryHi kz,
The problem with this code is that it still loads the posts without attachments into the loop as you’ve used the else condition. Even removing the else condition and simply using if(count($attachments) > 0) still counts the posts without attachments in the loop. I think they need to be excluded in the query_posts loop before even reaching the get_posts query.
Forum: Fixing WordPress
In reply to: Search Results ProblemThe great mystery is solved.
Notice something:
<?php if(have_posts()) : the_post(); while(have_posts()) : the_post(); ?>
For some reason I added an extra the_post. :S
Forum: Fixing WordPress
In reply to: Search Results ProblemI’m going to go over the functions.php file again. I really removed everything from it last time and the problem still occurred, but maybe I missed something. The queries on the index page work fine, but all other queries e.g. categories, search results etc. are affected. It’s as if an offset=1 hasn’t been closed and affecting everything.
Forum: Fixing WordPress
In reply to: Search Results ProblemTo add to my previous post, unsurprisingly it is all loops that are missing one post, the latest post. I just can’t find the source of the problem.
Forum: Fixing WordPress
In reply to: Category Array ProblemWorks like a charm. Thanks very much apljdi. 🙂
Forum: Fixing WordPress
In reply to: Separate search results by categoryI’ve finally got around to trying the code out. I’ve had no luck getting it to work, php really is not my strong point.
Thanks for the help though t31os_. It’s appreciated. I guess I’ll have to drop this idea for the search page.
Forum: Fixing WordPress
In reply to: Separate search results by categoryI appreciate the help t31os_. 😀
Before I play around with the code. Would it be possible to achieve something like this: http://www.ghostpool.com/customs/?s=lorem
1) I only want specific categories to be displayed in the search results e.g. videos, photos, fonts.
2) Assign a category title in between each group of results.
3) Style each group of results differently e.g. video category search results have thumbnail images and font search results just display text.
Forum: Fixing WordPress
In reply to: Separate search results by categoryHi t31os_,
I’ve tried incorporating what you’ve said (although I may have done it wrongly) and still no luck. I really hope hope you can help me out.
<?php rewind_posts(); $args = array( 'cat' => $theme_motionstok_cat, ); $wp_query->query = new WP_Query($args); ?> <h2 class="search-title"><?php single_cat_title(); ?> (<?php echo $wp_query->found_posts; ?>)</h2> <div class="search-content"> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php include('search-content.php'); ?> <?php endwhile; ?> </div>Forum: Fixing WordPress
In reply to: Separate search results by categoryt31os_, no post will ever be in one of the other categories, it’s just assigned to the one category.
Forum: Fixing WordPress
In reply to: $wp_query, &paged, and page navigationTry this:
<?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('&posts_per_page=30'.'&paged='.$paged); if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); get_image('image','thumbnail','','','thumbnail gallery'); } ?> <?php $wp_query = null; $wp_query = $temp;?>Forum: Plugins
In reply to: [Plugin: Tabbed Widgets] Add Extra InformationI figured out a way of doing this. You need to edit widget.php and find
* Display recent entries widget.Add your own code near the where the title of the post is being called.