18,423 reputation
31859
bio website tomjn.com
location United Kingdom
age 26
visits member for 4 years, 10 months
seen 4 hours ago

I’m a VIP Wrangler at Automattic, a former Code For The People developer, a speaker at conferences, and an elected community moderator at WordPress Stack Exchange.

I also blog about WordPress and PHP at http://tomjn.com


1d
answered How to use wp-cli with php?
1d
revised Update Gallery Randomly in every hour with no duplicates?
added 658 characters in body
1d
comment Update Gallery Randomly in every hour with no duplicates?
The codex is being replaced by the developer hub at developer.wordpress.org, you can use pre_get_post to set the order to random, but the changing every hour part doesn't make a lot of sense and will be very difficult to accomplish. If you're aware of any place in the codex that recommends using query_posts please link me to it so that it can be ammended
2d
awarded  Nice Question
2d
comment Update Gallery Randomly in every hour with no duplicates?
As I said, $do_not_duplicate is undefined, you've not told us where it comes from. Also, having randomly ordered posts with pagination makes no sense unless they're always ordered the same way, which means they'd no longer be random. Your comment does suggest however, that you're trying to replace a pages main query, so pre_get_posts is what you should be using, so that pagination still works.
Jul
1
answered Update Gallery Randomly in every hour with no duplicates?
Jul
1
comment Update Gallery Randomly in every hour with no duplicates?
You should never use query_posts, under any circumstances. If you want to modify a query, use the pre_get_posts filter, if you want to create a new or temporary query, use WP_Query or get_posts
Jun
24
comment Need fixing generic posting on facebook
These are done via opengraph tags
Jun
24
comment Is post_class(); going to slow Wordpress page speed
There's no such thing as a free function call, even echo ''; will affect page load times, albeit in an insignificant way
Jun
15
comment Is WP-Cron / wp_schedule_event suitable for time-consuming actions?
WP CLI is another candidate for long running tasks, what is your time consuming task?
Jun
13
comment how can I use WP_Query to exclude a specific tag.?
I would note that the performances of searches such as post__not_in don't scale very well on larger sites
Jun
13
comment Remove trailing slash
You should ask "How do I prevent indexing on paginated archives?", this permalinks here but not there stuff is an XY issue and overcomplicated
Jun
13
comment screwed-up my blog..what should I do
Renaming wp_options to wp_optons is like turning the frontal lobe of your brain into a puffer fish when you have a stupid moment, in the hopes that it'll grow a smarter frontal lobe as a replacement. Rename it back to wp_options and focus on your original problem instead. Any information you can provide about how your site is setup would be great, e.g. is it a multisite install, subdomain or subdirectory, you're upgrading from v? to v? etc
Jun
13
comment Disable domain redirect
You set your DOMAIN_CURRENT_SITE, perhaps you've set it incorrectly? Try removing that line
Jun
13
comment Is it possible to create an alias/custom taxonomy for a category name?
I don't see why you would need to destroy your posts and recreate them, just loop over each post, grab the category, and use the result to set the terms in your new taxonomies. A WP CLI command would be ideal. ( categories and tags are taxonomies too, the only difference is they're bundled with WordPress )
Jun
13
comment How to log mysql errors from wordpress core?
no error_log?
Jun
13
comment How to log mysql errors from wordpress core?
What are you doing that cannot be done with $wpdb or WP_Query?
Jun
13
answered Is it possible to create an alias/custom taxonomy for a category name?
Jun
13
comment Is it possible to create an alias/custom taxonomy for a category name?
You create 3 taxonomies, Operating System ( e.g. Android, iOS), Price ( free, paid ), and a heirarchical category type taxonomy ( Health/Medical -> Anesthesiology ). Then your problem becomes significantly more manageable, and you don't all the problems that duplicating terms is giving you. All you then need is to list posts using the terms and taxonomies available ( e.g. the posts in the free price tag, and the iOS operating system tag, in the Health type )
Jun
13
comment Category - “No content found”
localhost has nothing to do with my previous comment in any way shape or form, you can check for calls to query_posts by searching for query_posts in your theme with your editor, same with pre_get_posts. You can test if it happens with the default theme, by activating the default theme. You can test it's not a plugin by deactivating all your plugins