| bio | website | maorb.info |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 2 years, 6 months |
| seen | May 9 at 9:02 | |
| stats | profile views | 27 |
|
Jun 19 |
comment |
Get posts by menu ID @Jules, you are right that in that way there will be a db query for each post. You can make it more efficient by something like this: foreach ($nav_items as $obj) {
$objid = $obj->object_id;
$postobjArr[] = $obj->object_id; //save array of post ids
} $postobj = get_posts(array('post__in' => $postobjArr)); //get all posts in one time and do stuff with them..
|
|
Jun 17 |
answered | Get posts by menu ID |
|
May 27 |
awarded | Student |
|
May 23 |
asked | Get search term not on searh results page? |
|
May 22 |
comment |
How to highlight search terms without plugin What about highlighting the search term after the user clicks on the single and goes inside the post? Then the get_search_query() returns an empty string |
|
Apr 24 |
comment |
Custom query with orderby meta_value of custom field Well, yes, this is the old method for doing this query and it appears to be working for this specified one. Anyway, for more complex queries, it won't work. I found this is a known issue that is being taken care of, details can be found in trac tickets #15031 and #17065 |
|
Apr 23 |
asked | Custom query with orderby meta_value of custom field |
|
Apr 22 |
answered | Can't add a class to links in the visual editor since WP 3.1? |
|
Apr 22 |
awarded | Supporter |
|
Apr 10 |
answered | How do I display a user specific content? |
|
Mar 29 |
awarded | Enthusiast |
|
Feb 3 |
awarded | Teacher |
|
Jan 29 |
comment |
Modify main loop query for paged and meta key @goldenapples, please see below I added some code that might complete your answer. Thanks |
|
Jan 29 |
answered | Modify main loop query for paged and meta key |
|
Jan 29 |
comment |
Modify main loop query for paged and meta key Since the featured items are dynamic. Offset removes the first X posts from the query, but featured item can be any item in the entire blog, not necessarily the last 3 new ones |
|
Jan 29 |
comment |
Modify main loop query for paged and meta key A 2ns issue with this (but less important for now), is since we use parameter $paged-1, so plugins like wp_page_navi don't show the correct number of page , and when on page 2 it shows number 1 etc. Anyway, this is less important now, I might show only links to prev/next pages and not for page numbers or so. |
|
Jan 28 |
comment |
Modify main loop query for paged and meta key I tested it and it appears it getting close to what is needed here. The problem now is now as this: suppose I chose as "featured" posts to be posts #3, 10, 11. So, in the main loop in the homepage (which shows all posts besides the featured) I get posts #1,2,4,5,6,7,8. Then, the 2nd page shows me 3,9,10,11,12,13,14. This is better than what I got before, since now I have the posts naturally there, but the post #3 shouldn't appear on page 2, since it's not in place. How can I avoid that ? |
|
Jan 28 |
comment |
Modify main loop query for paged and meta key I can't use sticky in this case, since I handle this meta_key to show it as an additional column in the edit posts admin panel and I also use some Ajax to let the admin change the status from featured / not featured and so on. The meta_value is being properly changed in the db with Ajax, and I want to find a way to use this meta key to implement that. I don't want to use the sticky in here. I'm going to test your solution you suggested in the answer below |
|
Jan 28 |
asked | Modify main loop query for paged and meta key |
|
Jan 25 |
comment |
How to link categories to custom taxonomy terms? Thanks for your answer. I don't mind doing it with ajax, I already use some ajax in the admin panel for something else, it's not that important if the change will make ajax call to load the appropriate terms related to the category or if it will be just show/hide it with js. The question if this is the right method, since it might be that I would like to keep the way of the tags style of selecting terms etc. |