343 reputation
1410
bio website maorb.info
location
age
visits member for 3 years, 7 months
seen Jul 23 at 23:00

Jan
14
comment How to get the post publish date outside the loop?
According to the Codex, get_the_time tag must be used within The Loop. codex.wordpress.org/Function_Reference/get_the_time
Dec
6
comment How to change default position of WP meta boxes?
Thanks @anmari for sharing this approach, really helpful.
Oct
6
comment Group WP_Query by category
This is sort of unefficient way to do it, if you have a lot of categories fetched, since foreach category you do a separate get_posts call which calls the db each time.
Jul
25
comment Custom permalink structure for custom post type
This plugin no longer works in WP3.4 and also not available in the repository. Are there other implementation ideas for this issue?
Jul
25
comment Custom permalink structure for custom post type
@JohnPBloch The custom-post-permalinks that suggested here worked great, but now it is no longet available in the plugin repository and the plugin does not work with WP3.4.
Feb
21
comment How to Require a Minimum Image Dimension for Uploading?
This runs every time when you are uploading a file, in the step it is still just a file, before you categorize it or assign it as a thumbnail. You can add a condition based on the file's name with a prefix/suffix of your choice, and name your thumbnailed to be files by this, than do not run the function if file name meets that condition.
Sep
13
comment Can't add a class to links in the visual editor since WP 3.1?
This is exactly the issue, for letting the user to have different anchor classes. For example, I have a site that the editor needs sometimes a very big button in s special location on page. I added that class to the tinyMCE, and editor knows that whenever he needs that button, he just add this button from the list, and then the class is being added for this one special link on the page. I am still looking for a good solution for this issue, if you have any I'll be happy to hear.. Thanks
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..
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
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
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
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.
Jan
25
comment How to link categories to custom taxonomy terms?
There are channels (categories) and subjects (the other taxonomy). Each channel has separate subjects associated, and is needed to be both separated by name in the front end and also in the admin. The admin should see "subjects" as a separate meta box and not as "sub channels"